ruiite commited on
Commit
68ef79c
1 Parent(s): 8f9cd73

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
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
- v = Visualizer(img,scale=1.2)
 
 
 
 
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()