Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1102,7 +1102,7 @@ def predict_with_paper(image, paper_size, offset, offset_unit, finger_clearance=
|
|
| 1102 |
scale_info
|
| 1103 |
)
|
| 1104 |
|
| 1105 |
-
def predict_full_paper(image, paper_size, offset_value_mm,offset_unit, enable_finger_cut, selected_outputs):
|
| 1106 |
finger_flag = "On" if enable_finger_cut == "On" else "Off"
|
| 1107 |
|
| 1108 |
# Always get all outputs from predict_with_paper
|
|
@@ -1167,31 +1167,31 @@ if __name__ == "__main__":
|
|
| 1167 |
info="Select the paper size used in your image"
|
| 1168 |
)
|
| 1169 |
|
| 1170 |
-
with gr.Group():
|
| 1171 |
-
|
| 1172 |
-
|
| 1173 |
-
|
| 1174 |
-
|
| 1175 |
-
|
| 1176 |
-
|
| 1177 |
-
|
| 1178 |
-
|
| 1179 |
-
|
| 1180 |
-
|
| 1181 |
-
|
| 1182 |
-
|
| 1183 |
-
|
| 1184 |
-
|
| 1185 |
-
|
| 1186 |
-
|
| 1187 |
-
with gr.Group():
|
| 1188 |
-
|
| 1189 |
-
|
| 1190 |
-
|
| 1191 |
-
|
| 1192 |
-
|
| 1193 |
-
|
| 1194 |
-
|
| 1195 |
|
| 1196 |
output_options = gr.CheckboxGroup(
|
| 1197 |
choices=["Annotated Image", "Outlines", "Mask"],
|
|
@@ -1233,9 +1233,9 @@ if __name__ == "__main__":
|
|
| 1233 |
inputs=[
|
| 1234 |
input_image,
|
| 1235 |
paper_size,
|
| 1236 |
-
offset_value_mm,
|
| 1237 |
-
offset_unit,
|
| 1238 |
-
enable_finger_cut,
|
| 1239 |
output_options
|
| 1240 |
],
|
| 1241 |
outputs=[dxf_file, output_image, outlines_image, mask_image, scale_info]
|
|
|
|
| 1102 |
scale_info
|
| 1103 |
)
|
| 1104 |
|
| 1105 |
+
def predict_full_paper(image, paper_size, offset_value_mm = 0.02,offset_unit='mm', enable_finger_cut='Off', selected_outputs):
|
| 1106 |
finger_flag = "On" if enable_finger_cut == "On" else "Off"
|
| 1107 |
|
| 1108 |
# Always get all outputs from predict_with_paper
|
|
|
|
| 1167 |
info="Select the paper size used in your image"
|
| 1168 |
)
|
| 1169 |
|
| 1170 |
+
# with gr.Group():
|
| 1171 |
+
# gr.Markdown("### Contour Offset")
|
| 1172 |
+
# with gr.Row():
|
| 1173 |
+
# offset_value_mm = gr.Number(
|
| 1174 |
+
# value=0.02,
|
| 1175 |
+
# label="Offset",
|
| 1176 |
+
# info="Expand contours outward by this amount",
|
| 1177 |
+
# precision=3,
|
| 1178 |
+
# minimum=0,
|
| 1179 |
+
# maximum=50
|
| 1180 |
+
# )
|
| 1181 |
+
# offset_unit = gr.Dropdown(
|
| 1182 |
+
# choices=["mm", "inches"],
|
| 1183 |
+
# value="mm",
|
| 1184 |
+
# label="Unit"
|
| 1185 |
+
# )
|
| 1186 |
+
|
| 1187 |
+
# with gr.Group():
|
| 1188 |
+
# gr.Markdown("### Finger Cuts")
|
| 1189 |
+
# enable_finger_cut = gr.Radio(
|
| 1190 |
+
# choices=["On", "Off"],
|
| 1191 |
+
# value="Off",
|
| 1192 |
+
# label="Enable Finger Cuts",
|
| 1193 |
+
# info="Add circular cuts for easier handling"
|
| 1194 |
+
# )
|
| 1195 |
|
| 1196 |
output_options = gr.CheckboxGroup(
|
| 1197 |
choices=["Annotated Image", "Outlines", "Mask"],
|
|
|
|
| 1233 |
inputs=[
|
| 1234 |
input_image,
|
| 1235 |
paper_size,
|
| 1236 |
+
# offset_value_mm,
|
| 1237 |
+
# offset_unit,
|
| 1238 |
+
# enable_finger_cut,
|
| 1239 |
output_options
|
| 1240 |
],
|
| 1241 |
outputs=[dxf_file, output_image, outlines_image, mask_image, scale_info]
|