Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -33,12 +33,12 @@ if not torch.cuda.is_available():
|
|
33 |
predictor = DefaultPredictor(cfg)
|
34 |
|
35 |
def inference(image):
|
36 |
-
|
37 |
|
38 |
-
|
39 |
|
40 |
-
|
41 |
-
outputs = predictor(
|
42 |
|
43 |
v = Visualizer(img,scale=1.2)
|
44 |
out = v.draw_instance_predictions(outputs["instances"].to("cpu"))
|
|
|
33 |
predictor = DefaultPredictor(cfg)
|
34 |
|
35 |
def inference(image):
|
36 |
+
print(image.height)
|
37 |
|
38 |
+
height = image.height
|
39 |
|
40 |
+
img = np.array(image.resize((500, height)))
|
41 |
+
outputs = predictor(img)
|
42 |
|
43 |
v = Visualizer(img,scale=1.2)
|
44 |
out = v.draw_instance_predictions(outputs["instances"].to("cpu"))
|