Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -101,7 +101,7 @@ def exclude_scaling_box(
|
|
| 101 |
bbox: np.ndarray,
|
| 102 |
orig_size: tuple,
|
| 103 |
processed_size: tuple,
|
| 104 |
-
expansion_factor: float = 1.
|
| 105 |
) -> np.ndarray:
|
| 106 |
# Unpack the bounding box
|
| 107 |
x_min, y_min, x_max, y_max = map(int, bbox)
|
|
@@ -335,8 +335,8 @@ def predict(image, offset, coin_size_mm):
|
|
| 335 |
Image.fromarray(dilated_mask).save("./outputs/scaled_mask_new.jpg")
|
| 336 |
outlines, contours = extract_outlines(dilated_mask)
|
| 337 |
shrunked_img_contours = cv2.drawContours(image, contours, -1, (0, 0, 255), thickness=2)
|
| 338 |
-
|
| 339 |
-
dxf = to_dxf(contours)
|
| 340 |
|
| 341 |
return (
|
| 342 |
shrunked_img_contours,
|
|
|
|
| 101 |
bbox: np.ndarray,
|
| 102 |
orig_size: tuple,
|
| 103 |
processed_size: tuple,
|
| 104 |
+
expansion_factor: float = 1.2,
|
| 105 |
) -> np.ndarray:
|
| 106 |
# Unpack the bounding box
|
| 107 |
x_min, y_min, x_max, y_max = map(int, bbox)
|
|
|
|
| 335 |
Image.fromarray(dilated_mask).save("./outputs/scaled_mask_new.jpg")
|
| 336 |
outlines, contours = extract_outlines(dilated_mask)
|
| 337 |
shrunked_img_contours = cv2.drawContours(image, contours, -1, (0, 0, 255), thickness=2)
|
| 338 |
+
dxf = save_dxf_spline(contours, scaling_factor, processed_size[0])
|
| 339 |
+
# dxf = to_dxf(contours)
|
| 340 |
|
| 341 |
return (
|
| 342 |
shrunked_img_contours,
|