Update handler.py
Browse files- handler.py +2 -1
handler.py
CHANGED
|
@@ -73,7 +73,8 @@ class EndpointHandler():
|
|
| 73 |
else:
|
| 74 |
annotated = result[0].plot(labels=False, conf=False)[:,:,::-1]
|
| 75 |
except: # in case there is no detection
|
| 76 |
-
x1, y1, x2, y2 = 0, 0, W, H
|
|
|
|
| 77 |
|
| 78 |
h, w = y2-y1, x2-x1
|
| 79 |
offset = abs(h-w) // 2
|
|
|
|
| 73 |
else:
|
| 74 |
annotated = result[0].plot(labels=False, conf=False)[:,:,::-1]
|
| 75 |
except: # in case there is no detection
|
| 76 |
+
# x1, y1, x2, y2 = 0, 0, W, H
|
| 77 |
+
return img.tolist(), "🤔 Hmm... Mình không thấy bạn rùa nào trong bức ảnh này. Bạn hãy tải lên một bức hình khác nhé."
|
| 78 |
|
| 79 |
h, w = y2-y1, x2-x1
|
| 80 |
offset = abs(h-w) // 2
|