Skip to content

Commit

Permalink
bugfix(import coco): fix import coco prediction
Browse files Browse the repository at this point in the history
  • Loading branch information
imhuwq committed Dec 29, 2023
1 parent 6112526 commit 3cb3e79
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion deepdataspace/plugins/coco2017/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from typing import Dict
from typing import List
from typing import Tuple
import traceback

from deepdataspace.constants import DatasetFileType
from deepdataspace.constants import DatasetType
Expand Down Expand Up @@ -94,8 +95,11 @@ def parse_meta(meta_path: str):
try:
info = COCO2017Importer._parse_meta(meta_path)
except Exception as err:
logger.error(traceback.format_exc())
logger.error(f"Failed to parse meta file {meta_path}: {err}")
return None

logger.info(f"Successfully parsed meta file {meta_path}: {info}")
return info

def load_ground_truth(self):
Expand All @@ -118,7 +122,7 @@ def load_ground_truth(self):

def load_predictions(self):
for file_tag, file_path in self.dataset.files.items():
if not file_tag.startswith("PRED/"):
if not file_tag.startswith(f"{DatasetFileType.Prediction}/"):
continue

pred_name = file_tag.split("/", 1)[-1]
Expand Down

0 comments on commit 3cb3e79

Please sign in to comment.