Spaces:
Runtime error
Runtime error
Commit
·
660fabe
1
Parent(s):
6f4a3d8
Update app.py
Browse files
app.py
CHANGED
@@ -38,8 +38,8 @@ file = st.file_uploader("Please upload an image file(JPG/PNG/JPEG format)", type
|
|
38 |
|
39 |
st.set_option('deprecation.showfileUploaderEncoding', False)
|
40 |
|
41 |
-
|
42 |
-
|
43 |
|
44 |
if not torch.cuda.is_available():
|
45 |
cfg.MODEL.DEVICE='cpu'
|
@@ -52,7 +52,7 @@ def inference(image):
|
|
52 |
img = np.array(image)
|
53 |
outputs = predictor(img)
|
54 |
v = Visualizer(img[:, :, ::-1],
|
55 |
-
metadata=
|
56 |
scale=0.5,
|
57 |
instance_mode=ColorMode.IMAGE_BW
|
58 |
)
|
|
|
38 |
|
39 |
st.set_option('deprecation.showfileUploaderEncoding', False)
|
40 |
|
41 |
+
gun_metadata = MetadataCatalog.get("gun_data")
|
42 |
+
gun_metadata.thing_classes = ['guns','Gun']
|
43 |
|
44 |
if not torch.cuda.is_available():
|
45 |
cfg.MODEL.DEVICE='cpu'
|
|
|
52 |
img = np.array(image)
|
53 |
outputs = predictor(img)
|
54 |
v = Visualizer(img[:, :, ::-1],
|
55 |
+
metadata=gun_metadata,
|
56 |
scale=0.5,
|
57 |
instance_mode=ColorMode.IMAGE_BW
|
58 |
)
|