Skip to content

Commit

Permalink
removing base_module] fbcode/deeplearning/projects/cityscapesApi/TARGETS
Browse files Browse the repository at this point in the history
Reviewed By: azad-meta

Differential Revision: D67442902

fbshipit-source-id: 71e9da8b63cc5cbd7a68f51651ce0dcaece8b0db
  • Loading branch information
generatedunixname89002005287564 authored and facebook-github-bot committed Dec 19, 2024
1 parent c69939a commit 4823082
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions detectron2/data/datasets/cityscapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def load_cityscapes_instances(image_dir, gt_dir, from_json=True, to_polygons=Tru
logger.info("Loaded {} images from {}".format(len(ret), image_dir))

# Map cityscape ids to contiguous ids
from cityscapesscripts.helpers.labels import labels
from deeplearning.projects.cityscapesApi.cityscapesscripts.helpers.labels import labels

labels = [l for l in labels if l.hasInstances and not l.ignoreInEval]
dataset_id_to_contiguous_id = {l.id: idx for idx, l in enumerate(labels)}
Expand Down Expand Up @@ -138,7 +138,7 @@ def _cityscapes_files_to_dict(files, from_json, to_polygons):
Returns:
A dict in Detectron2 Dataset format.
"""
from cityscapesscripts.helpers.labels import id2label, name2label
from deeplearning.projects.cityscapesApi.cityscapesscripts.helpers.labels import id2label, name2label

image_file, instance_id_file, _, json_file = files

Expand Down Expand Up @@ -294,7 +294,7 @@ def main() -> None:
parser.add_argument("gt_dir")
parser.add_argument("--type", choices=["instance", "semantic"], default="instance")
args = parser.parse_args()
from cityscapesscripts.helpers.labels import labels
from deeplearning.projects.cityscapesApi.cityscapesscripts.helpers.labels import labels
from detectron2.data.catalog import Metadata
from detectron2.utils.visualizer import Visualizer

Expand Down
8 changes: 4 additions & 4 deletions detectron2/evaluation/cityscapes_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class CityscapesInstanceEvaluator(CityscapesEvaluator):
"""

def process(self, inputs, outputs):
from cityscapesscripts.helpers.labels import name2label
from deeplearning.projects.cityscapesApi.cityscapesscripts.helpers.labels import name2label

for input, output in zip(inputs, outputs):
file_name = input["file_name"]
Expand Down Expand Up @@ -96,7 +96,7 @@ def evaluate(self):
comm.synchronize()
if comm.get_rank() > 0:
return
import cityscapesscripts.evaluation.evalInstanceLevelSemanticLabeling as cityscapes_eval
import deeplearning.projects.cityscapesApi.cityscapesscripts.evaluation.evalInstanceLevelSemanticLabeling as cityscapes_eval, deeplearning.projects.cityscapesApi.cityscapesscripts.evaluation.evalInstanceLevelSemanticLabeling

self._logger.info("Evaluating results under {} ...".format(self._temp_dir))

Expand Down Expand Up @@ -140,7 +140,7 @@ class CityscapesSemSegEvaluator(CityscapesEvaluator):
"""

def process(self, inputs, outputs):
from cityscapesscripts.helpers.labels import trainId2label
from deeplearning.projects.cityscapesApi.cityscapesscripts.helpers.labels import trainId2label

for input, output in zip(inputs, outputs):
file_name = input["file_name"]
Expand All @@ -161,7 +161,7 @@ def evaluate(self):
return
# Load the Cityscapes eval script *after* setting the required env var,
# since the script reads CITYSCAPES_DATASET into global variables at load time.
import cityscapesscripts.evaluation.evalPixelLevelSemanticLabeling as cityscapes_eval
import deeplearning.projects.cityscapesApi.cityscapesscripts.evaluation.evalPixelLevelSemanticLabeling as cityscapes_eval, deeplearning.projects.cityscapesApi.cityscapesscripts.evaluation.evalPixelLevelSemanticLabeling

self._logger.info("Evaluating results under {} ...".format(self._temp_dir))

Expand Down

0 comments on commit 4823082

Please sign in to comment.