MikkoLipsanen commited on
Commit
3351c8b
·
verified ·
1 Parent(s): e1246f9

Update segment_image.py

Browse files
Files changed (1) hide show
  1. segment_image.py +2 -2
segment_image.py CHANGED
@@ -61,7 +61,7 @@ class SegmentImage:
61
  try:
62
  # Load the trained line detection model
63
  cached_model_path = hf_hub_download(repo_id=self.line_model_path, filename="lines_20240827.pt")
64
- line_model = YOLO(cached_model_path, hf_token=os.getenv("HF_TOKEN"))
65
  return line_model
66
  except Exception as e:
67
  print('Failed to load the line detection model: %s' % e)
@@ -71,7 +71,7 @@ class SegmentImage:
71
  try:
72
  # Load the trained line detection model
73
  cached_model_path = hf_hub_download(repo_id=self.region_model_path, filename="tuomiokirja_regions_04122023.pt")
74
- region_model = YOLO(cached_model_path, hf_token=os.getenv("HF_TOKEN"))
75
  return region_model
76
  except Exception as e:
77
  print('Failed to load the region detection model: %s' % e)
 
61
  try:
62
  # Load the trained line detection model
63
  cached_model_path = hf_hub_download(repo_id=self.line_model_path, filename="lines_20240827.pt")
64
+ line_model = YOLO(cached_model_path)
65
  return line_model
66
  except Exception as e:
67
  print('Failed to load the line detection model: %s' % e)
 
71
  try:
72
  # Load the trained line detection model
73
  cached_model_path = hf_hub_download(repo_id=self.region_model_path, filename="tuomiokirja_regions_04122023.pt")
74
+ region_model = YOLO(cached_model_path)
75
  return region_model
76
  except Exception as e:
77
  print('Failed to load the region detection model: %s' % e)