Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -51,8 +51,8 @@ device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cp
|
|
| 51 |
model = torch.load('pickel.pth',map_location=torch.device('cpu'))
|
| 52 |
model = model.to(device)
|
| 53 |
|
| 54 |
-
|
| 55 |
-
def predict(img)
|
| 56 |
|
| 57 |
# Start a timer
|
| 58 |
start_time = timer()
|
|
@@ -71,7 +71,7 @@ def predict(img) -> Tuple[Dict, float]:
|
|
| 71 |
|
| 72 |
nms_prediction = apply_nms(predictions, iou_thresh=0.1)
|
| 73 |
|
| 74 |
-
plot_img_bbox(img, nms_prediction)
|
| 75 |
|
| 76 |
pred = np.array(Image.open("pred.jpg"))
|
| 77 |
|
|
|
|
| 51 |
model = torch.load('pickel.pth',map_location=torch.device('cpu'))
|
| 52 |
model = model.to(device)
|
| 53 |
|
| 54 |
+
#-> Tuple[Dict, float]
|
| 55 |
+
def predict(img) :
|
| 56 |
|
| 57 |
# Start a timer
|
| 58 |
start_time = timer()
|
|
|
|
| 71 |
|
| 72 |
nms_prediction = apply_nms(predictions, iou_thresh=0.1)
|
| 73 |
|
| 74 |
+
plot_img_bbox(np.array(img), nms_prediction)
|
| 75 |
|
| 76 |
pred = np.array(Image.open("pred.jpg"))
|
| 77 |
|