ruiite commited on
Commit
f5e76f1
1 Parent(s): fc9264e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -32,6 +32,8 @@ if not torch.cuda.is_available():
32
  cfg.MODEL.DEVICE='cpu'
33
 
34
  predictor = DefaultPredictor(cfg)
 
 
35
 
36
  def inference(image):
37
  print(image.height)
@@ -41,7 +43,7 @@ def inference(image):
41
  img = np.array(image.resize((500, height)))
42
  outputs = predictor(img)
43
  v = Visualizer(img[:, :, ::-1],
44
- #metadata=val_metadata_dicts,
45
  scale=0.5,
46
  instance_mode=ColorMode.SEGMENTATION # remove the colors of unsegmented pixels. This option is only available for segmentation models
47
  )
 
32
  cfg.MODEL.DEVICE='cpu'
33
 
34
  predictor = DefaultPredictor(cfg)
35
+ my_metadata = MetadataCatalog.get("car_dataset_val")
36
+ my_metadata.thing_classes = ["damage"]
37
 
38
  def inference(image):
39
  print(image.height)
 
43
  img = np.array(image.resize((500, height)))
44
  outputs = predictor(img)
45
  v = Visualizer(img[:, :, ::-1],
46
+ metadata=my_metadata,
47
  scale=0.5,
48
  instance_mode=ColorMode.SEGMENTATION # remove the colors of unsegmented pixels. This option is only available for segmentation models
49
  )