esun-choi commited on
Commit
a9ccd5e
1 Parent(s): ef0490d

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +9 -9
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=True, 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,16 +339,16 @@ def main(image_path0):
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
 
 
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