Spaces:
Running
Running
Revert to only show outline of bounding boxes.
Browse files
app.py
CHANGED
@@ -46,12 +46,12 @@ def detect(image):
|
|
46 |
vehicle_mask = Image.new(mode="L", size=image.size, color=255)
|
47 |
vehicle_draw = ImageDraw.Draw(vehicle_mask)
|
48 |
for vehicle_box in vehicle_boxes:
|
49 |
-
vehicle_draw.rectangle(vehicle_box.tolist(),
|
50 |
|
51 |
person_box_mask = Image.new(mode="L", size=image.size, color=255)
|
52 |
person_box_draw = ImageDraw.Draw(person_box_mask)
|
53 |
for person_box in seg_boxes[person_indices][:, :4]:
|
54 |
-
person_box_draw.rectangle(person_box.tolist(),
|
55 |
|
56 |
#TODO: move combination to caller function
|
57 |
combined_mask = Image.fromarray(np.minimum.reduce([np.array(m) for m in [people_mask, lp_mask]]))
|
|
|
46 |
vehicle_mask = Image.new(mode="L", size=image.size, color=255)
|
47 |
vehicle_draw = ImageDraw.Draw(vehicle_mask)
|
48 |
for vehicle_box in vehicle_boxes:
|
49 |
+
vehicle_draw.rectangle(vehicle_box.tolist(), outline = 0, width=5)
|
50 |
|
51 |
person_box_mask = Image.new(mode="L", size=image.size, color=255)
|
52 |
person_box_draw = ImageDraw.Draw(person_box_mask)
|
53 |
for person_box in seg_boxes[person_indices][:, :4]:
|
54 |
+
person_box_draw.rectangle(person_box.tolist(), outline = 0, width=5)
|
55 |
|
56 |
#TODO: move combination to caller function
|
57 |
combined_mask = Image.fromarray(np.minimum.reduce([np.array(m) for m in [people_mask, lp_mask]]))
|