Spaces:
Runtime error
Runtime error
still fixing requirements
Browse files- app.py +2 -1
- requirements.txt +2 -2
app.py
CHANGED
|
@@ -15,7 +15,8 @@ def inference(img:PIL.Image.Image, threshold:float=0.6):
|
|
| 15 |
return None,0
|
| 16 |
images:List[PIL.Image.Image] = [ img ] # inference operates on a list of images
|
| 17 |
model.conf = threshold
|
| 18 |
-
detections:torchvision.Detections = model(images, size=640)
|
|
|
|
| 19 |
predictions:torch.Tensor = detections.pred[0] # the predictions for our single image
|
| 20 |
detections.render() # bounding boxes and labels added into image
|
| 21 |
return detections.imgs[0], predictions.size(dim=0) # image and number of detections
|
|
|
|
| 15 |
return None,0
|
| 16 |
images:List[PIL.Image.Image] = [ img ] # inference operates on a list of images
|
| 17 |
model.conf = threshold
|
| 18 |
+
# detections:torchvision.Detections = model(images, size=640)
|
| 19 |
+
detections = model(images, size=640)
|
| 20 |
predictions:torch.Tensor = detections.pred[0] # the predictions for our single image
|
| 21 |
detections.render() # bounding boxes and labels added into image
|
| 22 |
return detections.imgs[0], predictions.size(dim=0) # image and number of detections
|
requirements.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
torch
|
| 2 |
-
torchvision
|
| 3 |
gradio==3.3.1
|
| 4 |
Pillow
|
| 5 |
opencv-python
|
|
|
|
| 1 |
+
torch>=0.12.1
|
| 2 |
+
torchvision>=0.13.1
|
| 3 |
gradio==3.3.1
|
| 4 |
Pillow
|
| 5 |
opencv-python
|