dalybuilds commited on
Commit
163ee7e
·
verified ·
1 Parent(s): 2e6655e

Update model_utils.py

Browse files
Files changed (1) hide show
  1. model_utils.py +3 -2
model_utils.py CHANGED
@@ -3,7 +3,7 @@
3
  from transformers import ViTForImageClassification
4
  from PIL import Image
5
  import torch
6
- from dataset_utils import load_species_descriptions
7
 
8
  class BugClassifier:
9
  def __init__(self, model_path="google/vit-base-patch16-224"):
@@ -15,7 +15,8 @@ class BugClassifier:
15
  "Luna Moth", "Common Dragonfly", "Honey Bee", "Paper Wasp"
16
  ]
17
  # Dynamically load species descriptions
18
- self.species_descriptions = load_species_descriptions()
 
19
 
20
  def predict(self, image):
21
  try:
 
3
  from transformers import ViTForImageClassification
4
  from PIL import Image
5
  import torch
6
+ from dataset_utils import DatasetHandler
7
 
8
  class BugClassifier:
9
  def __init__(self, model_path="google/vit-base-patch16-224"):
 
15
  "Luna Moth", "Common Dragonfly", "Honey Bee", "Paper Wasp"
16
  ]
17
  # Dynamically load species descriptions
18
+ handler = DatasetHandler()
19
+ self.species_descriptions = handler.load_descriptions(max_records=500)
20
 
21
  def predict(self, image):
22
  try: