@@ -276,14 +276,21 @@ def evaluate_network_cross_scene(dcn=None, dataset=None, save=True):
276
276
for annotated_pair in cross_scene_data :
277
277
278
278
scene_name_a = annotated_pair ["image_a" ]["scene_name" ]
279
- scene_name_b = annotated_pair ["image_b" ]["scene_name" ]
280
-
279
+ scene_name_b = annotated_pair ["image_b" ]["scene_name" ]
280
+
281
+ if not os .path .isdir (dataset .get_full_path_for_scene (scene_name_a ))\
282
+ or not os .path .isdir (dataset .get_full_path_for_scene (scene_name_b )):
283
+ print ("at least one of these scene names does not exist:" , scene_name_a , scene_name_b )
284
+ continue
285
+ print ("these scene names both exist:" , scene_name_a , scene_name_b )
286
+
281
287
image_a_idx = annotated_pair ["image_a" ]["image_idx" ]
282
288
image_b_idx = annotated_pair ["image_b" ]["image_idx" ]
283
289
284
290
img_a_pixels = annotated_pair ["image_a" ]["pixels" ]
285
291
img_b_pixels = annotated_pair ["image_b" ]["pixels" ]
286
292
293
+
287
294
dataframe_list_temp = \
288
295
DenseCorrespondenceEvaluation .single_cross_scene_image_pair_quantitative_analysis (dcn ,
289
296
dataset , scene_name_a , image_a_idx , scene_name_b , image_b_idx ,
@@ -1538,8 +1545,14 @@ def evaluate_network_qualitative_cross_scene(dcn, dataset, draw_human_annotation
1538
1545
for annotated_pair in cross_scene_data :
1539
1546
1540
1547
scene_name_a = annotated_pair ["image_a" ]["scene_name" ]
1541
- scene_name_b = annotated_pair ["image_b" ]["scene_name" ]
1542
-
1548
+ scene_name_b = annotated_pair ["image_b" ]["scene_name" ]
1549
+ # some labeled cross scene data may not be in the configured dataset
1550
+ # this checks that the scenes actually exist (i.e., have been downloaded)
1551
+ if not os .path .isdir (dataset .get_full_path_for_scene (scene_name_a ))\
1552
+ or not os .path .isdir (dataset .get_full_path_for_scene (scene_name_b )):
1553
+ print ("at least one of these scene names does not exist:" , scene_name_a , scene_name_b )
1554
+ continue
1555
+ print ("these scene names exist:" , scene_name_a , scene_name_b )
1543
1556
image_a_idx = annotated_pair ["image_a" ]["image_idx" ]
1544
1557
image_b_idx = annotated_pair ["image_b" ]["image_idx" ]
1545
1558
0 commit comments