File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,7 @@ def evaluate(
139
139
classes = None ,
140
140
colors = None
141
141
):
142
+ metric = MeanAveragePrecision (class_metrics = args ['verbose' ])
142
143
n_threads = torch .get_num_threads ()
143
144
# FIXME remove this and make paste_masks_in_image run on the GPU
144
145
torch .set_num_threads (1 )
@@ -172,13 +173,11 @@ def evaluate(
172
173
preds .append (preds_dict )
173
174
target .append (true_dict )
174
175
#####################################
175
-
176
176
outputs = [{k : v .to (cpu_device ) for k , v in t .items ()} for t in outputs ]
177
177
178
178
# gather the stats from all processes
179
179
metric_logger .synchronize_between_processes ()
180
180
torch .set_num_threads (n_threads )
181
- metric = MeanAveragePrecision (class_metrics = args ['verbose' ])
182
181
metric .update (preds , target )
183
182
metric_summary = metric .compute ()
184
183
return metric_summary
Original file line number Diff line number Diff line change 78
78
# Model configurations
79
79
IMAGE_WIDTH = args ['img_size' ]
80
80
IMAGE_HEIGHT = args ['img_size' ]
81
-
82
81
valid_dataset = create_valid_dataset (
83
- VALID_DIR_IMAGES , VALID_DIR_LABELS ,
84
- IMAGE_WIDTH , IMAGE_HEIGHT , CLASSES
85
- )
82
+ VALID_DIR_IMAGES ,
83
+ VALID_DIR_LABELS ,
84
+ args ['img_size' ],
85
+ CLASSES ,
86
+ square_training = True
87
+ )
86
88
valid_loader = create_valid_loader (valid_dataset , BATCH_SIZE , NUM_WORKERS )
87
89
88
90
coco_evaluator , stats = evaluate (
89
91
model ,
90
92
valid_loader ,
91
93
device = DEVICE ,
92
- classes = CLASSES ,
93
- )
94
+ # classes=CLASSES,
95
+ )
You can’t perform that action at this time.
0 commit comments