Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -49,7 +49,7 @@ parser.add_argument('--trained_model', default='weights/craft_mlt_25k.pth', type
|
|
49 |
parser.add_argument('--text_threshold', default=0.7, type=float, help='text confidence threshold')
|
50 |
parser.add_argument('--low_text', default=0.4, type=float, help='text low-bound score')
|
51 |
parser.add_argument('--link_threshold', default=0.4, type=float, help='link confidence threshold')
|
52 |
-
parser.add_argument('--cuda', default=
|
53 |
parser.add_argument('--canvas_size', default=1280, type=int, help='image size for inference')
|
54 |
parser.add_argument('--mag_ratio', default=1.5, type=float, help='image magnification ratio')
|
55 |
parser.add_argument('--poly', default=False, action='store_true', help='enable polygon type')
|
@@ -339,16 +339,16 @@ def main(image_path0):
|
|
339 |
return original_image
|
340 |
|
341 |
|
342 |
-
if __name__ == '__main__':
|
343 |
|
344 |
|
345 |
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
|
353 |
-
|
354 |
|
|
|
49 |
parser.add_argument('--text_threshold', default=0.7, type=float, help='text confidence threshold')
|
50 |
parser.add_argument('--low_text', default=0.4, type=float, help='text low-bound score')
|
51 |
parser.add_argument('--link_threshold', default=0.4, type=float, help='link confidence threshold')
|
52 |
+
parser.add_argument('--cuda', default=False, type=str2bool, help='Use cuda for inference')
|
53 |
parser.add_argument('--canvas_size', default=1280, type=int, help='image size for inference')
|
54 |
parser.add_argument('--mag_ratio', default=1.5, type=float, help='image magnification ratio')
|
55 |
parser.add_argument('--poly', default=False, action='store_true', help='enable polygon type')
|
|
|
339 |
return original_image
|
340 |
|
341 |
|
342 |
+
# if __name__ == '__main__':
|
343 |
|
344 |
|
345 |
|
346 |
+
# iface = gr.Interface(
|
347 |
+
# fn=main,
|
348 |
+
# inputs=gr.Image(type="filepath", label="Invoice Image"),
|
349 |
+
# outputs=gr.Image(type="pil", label="Masked Invoice Image"),
|
350 |
+
# live=True
|
351 |
+
# )
|
352 |
|
353 |
+
# iface.launch()
|
354 |
|