Spaces:
Runtime error
Runtime error
Added comment to remember what has to be done
Browse files- understand.py +9 -1
understand.py
CHANGED
@@ -64,7 +64,9 @@ results = processor.post_process_panoptic_segmentation(outputs, target_sizes=[im
|
|
64 |
|
65 |
|
66 |
def show_mask_for_number(map_to_use, label_id):
|
67 |
-
|
|
|
|
|
68 |
if torch.cuda.is_available():
|
69 |
mask = (map_to_use.cpu().numpy() == label_id)
|
70 |
else:
|
@@ -77,6 +79,9 @@ def show_mask_for_number(map_to_use, label_id):
|
|
77 |
|
78 |
|
79 |
def get_coordinates_for_bb_simple(map_to_use, label_id):
|
|
|
|
|
|
|
80 |
if torch.cuda.is_available():
|
81 |
mask = (map_to_use.cpu().numpy() == label_id)
|
82 |
else:
|
@@ -103,6 +108,9 @@ def make_simple_box(left_top, right_bottom, map_size):
|
|
103 |
|
104 |
|
105 |
def test(map_to_use, label_id):
|
|
|
|
|
|
|
106 |
if torch.cuda.is_available():
|
107 |
mask = (map_to_use.cpu().numpy() == label_id)
|
108 |
else:
|
|
|
64 |
|
65 |
|
66 |
def show_mask_for_number(map_to_use, label_id):
|
67 |
+
"""
|
68 |
+
map_to_use: You have to pass in `results["segmentation"]`
|
69 |
+
"""
|
70 |
if torch.cuda.is_available():
|
71 |
mask = (map_to_use.cpu().numpy() == label_id)
|
72 |
else:
|
|
|
79 |
|
80 |
|
81 |
def get_coordinates_for_bb_simple(map_to_use, label_id):
|
82 |
+
"""
|
83 |
+
map_to_use: You have to pass in `results["segmentation"]`
|
84 |
+
"""
|
85 |
if torch.cuda.is_available():
|
86 |
mask = (map_to_use.cpu().numpy() == label_id)
|
87 |
else:
|
|
|
108 |
|
109 |
|
110 |
def test(map_to_use, label_id):
|
111 |
+
"""
|
112 |
+
map_to_use: You have to pass in `results["segmentation"]`
|
113 |
+
"""
|
114 |
if torch.cuda.is_available():
|
115 |
mask = (map_to_use.cpu().numpy() == label_id)
|
116 |
else:
|