Spaces:
Sleeping
Sleeping
models.py has been modified
Browse files
models.py
CHANGED
@@ -115,7 +115,7 @@ def get_digit(model_path, image_path, threshold=0.5):
|
|
115 |
pred_list.append(((x1, x2, cls, score)))
|
116 |
|
117 |
pred_list = [i for i in pred_list if i[-1] > threshold]
|
118 |
-
|
119 |
sorted_number_list = sorted(pred_list, key=lambda x: x[0])
|
120 |
# sorted_number_list = sorted(sorted_number_list, reverse=True, key= lambda x: x[-1])
|
121 |
# output_digit = float(''.join([str(int(i[2])) if i[2]!=10 else '.' for i in sorted_number_list]))
|
|
|
115 |
pred_list.append(((x1, x2, cls, score)))
|
116 |
|
117 |
pred_list = [i for i in pred_list if i[-1] > threshold]
|
118 |
+
pred_list = [i for i in pred_list if i[0]>0 and i[1]>0]
|
119 |
sorted_number_list = sorted(pred_list, key=lambda x: x[0])
|
120 |
# sorted_number_list = sorted(sorted_number_list, reverse=True, key= lambda x: x[-1])
|
121 |
# output_digit = float(''.join([str(int(i[2])) if i[2]!=10 else '.' for i in sorted_number_list]))
|