offthewallace commited on
Commit
a6e1b28
·
1 Parent(s): cd9032a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -18,14 +18,12 @@ def detect(pdf):
18
  path_to_pdf = pdf.name
19
  imgs = pdf2image.convert_from_path(path_to_pdf)
20
  for i in range(len(imgs):
21
-
22
  result = model(np.array(imgs[i]))
23
  result_pred=result.pred
24
-
25
  for j in range(len(result_pred[0])):
26
  if result_pred[0][j][5]==1 and result_pred[i][j][4]>0.5:
27
  return {'not signature': 0, 'signature': 1}
28
- return return {'not signature': 1, 'signature': 0}
29
 
30
 
31
  inputs = gr.inputs.Image(type='pil', label="Original Image")
 
18
  path_to_pdf = pdf.name
19
  imgs = pdf2image.convert_from_path(path_to_pdf)
20
  for i in range(len(imgs):
 
21
  result = model(np.array(imgs[i]))
22
  result_pred=result.pred
 
23
  for j in range(len(result_pred[0])):
24
  if result_pred[0][j][5]==1 and result_pred[i][j][4]>0.5:
25
  return {'not signature': 0, 'signature': 1}
26
+ return {'not signature': 1, 'signature': 0}
27
 
28
 
29
  inputs = gr.inputs.Image(type='pil', label="Original Image")