Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -39,8 +39,12 @@ def inference(image):
|
|
39 |
|
40 |
img = np.array(image.resize((500, height)))
|
41 |
outputs = predictor(img)
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
|
|
44 |
out = v.draw_instance_predictions(outputs["instances"].to("cpu"))
|
45 |
|
46 |
return out.get_image()
|
|
|
39 |
|
40 |
img = np.array(image.resize((500, height)))
|
41 |
outputs = predictor(img)
|
42 |
+
v = Visualizer(img[:, :, ::-1],
|
43 |
+
#metadata=val_metadata_dicts,
|
44 |
+
scale=0.5,
|
45 |
+
instance_mode=ColorMode.IMAGE_BW # remove the colors of unsegmented pixels. This option is only available for segmentation models
|
46 |
+
)
|
47 |
+
# v = Visualizer(img,scale=1.2)
|
48 |
out = v.draw_instance_predictions(outputs["instances"].to("cpu"))
|
49 |
|
50 |
return out.get_image()
|