Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -279,7 +279,7 @@ def resize_img(img: np.ndarray, resize_dim):
|
|
279 |
return np.array(Image.fromarray(img).resize(resize_dim))
|
280 |
|
281 |
|
282 |
-
def predict(image, offset
|
283 |
|
284 |
if offset < 0:
|
285 |
raise gr.Error("Offset Value Can't be negative")
|
@@ -299,7 +299,7 @@ def predict(image, offset, coin_size_mm):
|
|
299 |
scaling_factor= calculate_scaling_factor(
|
300 |
reference_image_path="./coin.jpg",
|
301 |
target_image=reference_square_mask,
|
302 |
-
reference_obj_size_mm = coin_size_mm,
|
303 |
feature_detector="ORB",
|
304 |
)
|
305 |
except Exception as e:
|
@@ -355,7 +355,7 @@ if __name__ == "__main__":
|
|
355 |
inputs=[
|
356 |
gr.Image(label="Input Image", type="numpy"),
|
357 |
gr.Number(label="Offset value for Mask(mm)", value=0.15),
|
358 |
-
gr.Number(label="Diameter of reference coin(mm). Adjust according to coin.", value=
|
359 |
# gr.Dropdown(["en", "nl"], label="Language", value="en") # Default English
|
360 |
],
|
361 |
outputs=[
|
|
|
279 |
return np.array(Image.fromarray(img).resize(resize_dim))
|
280 |
|
281 |
|
282 |
+
def predict(image, offset):
|
283 |
|
284 |
if offset < 0:
|
285 |
raise gr.Error("Offset Value Can't be negative")
|
|
|
299 |
scaling_factor= calculate_scaling_factor(
|
300 |
reference_image_path="./coin.jpg",
|
301 |
target_image=reference_square_mask,
|
302 |
+
# reference_obj_size_mm = coin_size_mm,
|
303 |
feature_detector="ORB",
|
304 |
)
|
305 |
except Exception as e:
|
|
|
355 |
inputs=[
|
356 |
gr.Image(label="Input Image", type="numpy"),
|
357 |
gr.Number(label="Offset value for Mask(mm)", value=0.15),
|
358 |
+
gr.Number(label="Diameter of reference coin(mm). Adjust according to coin.", value=20),
|
359 |
# gr.Dropdown(["en", "nl"], label="Language", value="en") # Default English
|
360 |
],
|
361 |
outputs=[
|