Guy2 commited on
Commit
0b91e55
1 Parent(s): a00dc8b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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
- # return image
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')