Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -69,10 +69,9 @@ carTransforms = transforms.Compose([transforms.Resize(224),
|
|
| 69 |
def classifyCar(im):
|
| 70 |
#im = Image.fromarray(im.astype('uint8'), 'RGB')
|
| 71 |
im = cv2.imread(im)
|
| 72 |
-
|
| 73 |
-
outputs = predictor(im)
|
| 74 |
v = Visualizer(im[:, :, ::-1], MetadataCatalog.get(cfg.DATASETS.TRAIN[0]), scale=1.2)
|
| 75 |
-
out = v.draw_instance_predictions(outputs["instances"]
|
| 76 |
#im2 = carTransforms(im).unsqueeze(0) # transform and add batch dimension
|
| 77 |
#with torch.no_grad():
|
| 78 |
# scores = torch.nn.functional.softmax(DesignModernityModel(im2)[0])
|
|
|
|
| 69 |
def classifyCar(im):
|
| 70 |
#im = Image.fromarray(im.astype('uint8'), 'RGB')
|
| 71 |
im = cv2.imread(im)
|
| 72 |
+
outputs = predictor(im)
|
|
|
|
| 73 |
v = Visualizer(im[:, :, ::-1], MetadataCatalog.get(cfg.DATASETS.TRAIN[0]), scale=1.2)
|
| 74 |
+
out = v.draw_instance_predictions(outputs["instances"])
|
| 75 |
#im2 = carTransforms(im).unsqueeze(0) # transform and add batch dimension
|
| 76 |
#with torch.no_grad():
|
| 77 |
# scores = torch.nn.functional.softmax(DesignModernityModel(im2)[0])
|