Spaces:
Runtime error
Runtime error
update app.py
Browse files
app.py
CHANGED
@@ -162,8 +162,8 @@ def generate(
|
|
162 |
open_cv_image = np.array(image)
|
163 |
# Convert RGB to BGR
|
164 |
open_cv_image = open_cv_image[:, :, ::-1].copy()
|
165 |
-
for box in boxes:
|
166 |
-
|
167 |
out_image = Image.fromarray(cv2.cvtColor(open_cv_image, cv2.COLOR_BGR2RGB))
|
168 |
return f"Output:{box}", out_image
|
169 |
elif idx == 2:
|
|
|
162 |
open_cv_image = np.array(image)
|
163 |
# Convert RGB to BGR
|
164 |
open_cv_image = open_cv_image[:, :, ::-1].copy()
|
165 |
+
# for box in boxes:
|
166 |
+
open_cv_image = cv2.rectangle(open_cv_image, box[:2].astype(int), box[2:].astype(int), (255, 0, 0), 2)
|
167 |
out_image = Image.fromarray(cv2.cvtColor(open_cv_image, cv2.COLOR_BGR2RGB))
|
168 |
return f"Output:{box}", out_image
|
169 |
elif idx == 2:
|