Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,13 +4,12 @@ import torch
|
|
4 |
import supervision as sv
|
5 |
import json
|
6 |
|
|
|
|
|
|
|
7 |
def anylize(img):
|
8 |
-
id2label = {0: 'dangerous-items', 1: 'Gun', 2: 'Knife', 3: 'Pliers', 4: 'Scissors', 5: 'Wrench'}
|
9 |
image = img
|
10 |
|
11 |
-
processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50")
|
12 |
-
model = DetrForObjectDetection.from_pretrained("Guy2/AirportSec-100epoch")
|
13 |
-
|
14 |
with torch.no_grad():
|
15 |
|
16 |
inputs = image_processor(images=image, return_tensors='pt')
|
|
|
4 |
import supervision as sv
|
5 |
import json
|
6 |
|
7 |
+
image_processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50")
|
8 |
+
model = DetrForObjectDetection.from_pretrained("Guy2/AirportSec-100epoch")
|
9 |
+
id2label = {0: 'dangerous-items', 1: 'Gun', 2: 'Knife', 3: 'Pliers', 4: 'Scissors', 5: 'Wrench'}
|
10 |
def anylize(img):
|
|
|
11 |
image = img
|
12 |
|
|
|
|
|
|
|
13 |
with torch.no_grad():
|
14 |
|
15 |
inputs = image_processor(images=image, return_tensors='pt')
|