Vaish6 commited on
Commit
fcbd15c
·
verified ·
1 Parent(s): 235612f

Upload env.py

Browse files
Files changed (1) hide show
  1. env.py +1 -4
env.py CHANGED
@@ -43,11 +43,8 @@ def calculate_iou(box1: List[List[int]], box2: List[List[int]]) -> float:
43
  return inter_area / union_area
44
 
45
  class MetaOCTEnv:
46
- def __init__(self, data_dir: str = "images", truth_file: str = "ground_truth.json", difficulty: str = "medium"):
47
  self.data_dir = data_dir
48
- # Support both flat root upload (HuggingFace) and local images/ folder
49
- if not os.path.isdir(data_dir):
50
- self.data_dir = "." # Fallback to root directory
51
  with open(truth_file, "r") as f:
52
  self.ground_truth = json.load(f)
53
  self.image_files = list(self.ground_truth.keys())
 
43
  return inter_area / union_area
44
 
45
  class MetaOCTEnv:
46
+ def __init__(self, data_dir: str = ".", truth_file: str = "ground_truth.json", difficulty: str = "medium"):
47
  self.data_dir = data_dir
 
 
 
48
  with open(truth_file, "r") as f:
49
  self.ground_truth = json.load(f)
50
  self.image_files = list(self.ground_truth.keys())