Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ model = DetrForObjectDetection.from_pretrained("Guy2/AirportSec-150epoch")
|
|
12 |
id2label = {0: 'dangerous-items', 1: 'Gun', 2: 'Knife', 3: 'Pliers', 4: 'Scissors', 5: 'Wrench'}
|
13 |
def anylize(url):
|
14 |
image = Image.open(requests.get(url, stream=True).raw)
|
15 |
-
|
16 |
with torch.no_grad():
|
17 |
|
18 |
inputs = image_processor(images=image, return_tensors='pt')
|
|
|
12 |
id2label = {0: 'dangerous-items', 1: 'Gun', 2: 'Knife', 3: 'Pliers', 4: 'Scissors', 5: 'Wrench'}
|
13 |
def anylize(url):
|
14 |
image = Image.open(requests.get(url, stream=True).raw)
|
15 |
+
image = image.convert('RGB')
|
16 |
with torch.no_grad():
|
17 |
|
18 |
inputs = image_processor(images=image, return_tensors='pt')
|