add support for non-local entry paths in query_db
Summary: Add support for entries with non-local image file paths to `query_db` tool
@@ -8,6 +8,7 @@ import sys
from timeit import default_timer as timer
from typing import Any, ClassVar, Dict, List
import torch
+from fvcore.common.file_io import PathManager
from detectron2.data.catalog import DatasetCatalog
from detectron2.utils.logger import setup_logger
@@ -162,7 +163,7 @@ class ShowAction(EntrywiseAction):
import cv2
import numpy as np
- image_fpath = entry["file_name"]
+ image_fpath = PathManager.get_local_path(entry["file_name"])
image = cv2.imread(image_fpath, cv2.IMREAD_GRAYSCALE)
image = np.tile(image[:, :, np.newaxis], [1, 1, 3])
datas = cls._extract_data_for_visualizers_from_entry(context["vis_specs"], entry)
