Skip to content
Snippets Groups Projects
Commit be3ec5ae authored by Mathieu Beligon's avatar Mathieu Beligon
Browse files

[common] (LabelMap) Move to parent folder and simplify usage

parent 6bfede69
No related branches found
No related tags found
No related merge requests found
......@@ -4,4 +4,4 @@ PROJECT_DIR: Path = Path(__file__).parent.parent.parent.parent
RESOURCES_DIR: Path = PROJECT_DIR / "resources"
MODELS_DIR: Path = RESOURCES_DIR / "models"
LABEL_MAP_PATH: Path = PROJECT_DIR / "dataset" / "tf_records" / "label_map.pbtxt"
LABEL_MAP_PATH: Path = PROJECT_DIR / "dataset" / "label_map.pbtxt"
import re
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, Any, List
from typing import Any, Dict, List
from dataclasses import dataclass
from polystar.common.constants import LABEL_MAP_PATH
@dataclass
......@@ -30,3 +31,6 @@ class LabelMap:
name2id = {n: int(i) for i, n in d.items()}
id2name = d
return LabelMap(id2name=id2name, name2id=name2id)
label_map = LabelMap.from_file(LABEL_MAP_PATH)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment