DawnC commited on
Commit
4d78afe
1 Parent(s): 87a2e42

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -152,7 +152,7 @@ def preprocess_image(image):
152
 
153
  return transform(image).unsqueeze(0)
154
 
155
- @spaces.GPU
156
  async def predict_single_dog(image):
157
  """
158
  Predicts the dog breed using only the classifier.
@@ -185,7 +185,7 @@ async def predict_single_dog(image):
185
  return probabilities[0], breeds[:3], relative_probs
186
 
187
 
188
- @spaces.GPU
189
  async def detect_multiple_dogs(image, conf_threshold=0.3, iou_threshold=0.55):
190
  results = model_yolo(image, conf=conf_threshold, iou=iou_threshold)[0]
191
  dogs = []
@@ -268,7 +268,7 @@ def create_breed_comparison(breed1: str, breed2: str) -> dict:
268
  return comparison_data
269
 
270
 
271
- @spaces.GPU
272
  async def predict(image):
273
  """
274
  Main prediction function that handles both single and multiple dog detection.
 
152
 
153
  return transform(image).unsqueeze(0)
154
 
155
+ @spaces.GPU()
156
  async def predict_single_dog(image):
157
  """
158
  Predicts the dog breed using only the classifier.
 
185
  return probabilities[0], breeds[:3], relative_probs
186
 
187
 
188
+ @spaces.GPU()
189
  async def detect_multiple_dogs(image, conf_threshold=0.3, iou_threshold=0.55):
190
  results = model_yolo(image, conf=conf_threshold, iou=iou_threshold)[0]
191
  dogs = []
 
268
  return comparison_data
269
 
270
 
271
+ @spaces.GPU()
272
  async def predict(image):
273
  """
274
  Main prediction function that handles both single and multiple dog detection.