Chintan-Shah commited on
Commit
38b3ee8
·
verified ·
1 Parent(s): 0893248

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -16,7 +16,8 @@ text_inputs = torch.cat([clip.tokenize(f"a photo of a {c}") for c in cifar100.cl
16
  def generateOutput(source):
17
  # Prepare the inputs
18
  # image, class_id = cifar100[3637]
19
- image_input = preprocess(source).unsqueeze(0).to(device)
 
20
 
21
  with torch.no_grad():
22
  image_features = model.encode_image(image_input)
 
16
  def generateOutput(source):
17
  # Prepare the inputs
18
  # image, class_id = cifar100[3637]
19
+ image = Image.fromarray(image.astype('uint8'), 'RGB')
20
+ image_input = preprocess(image).unsqueeze(0).to(device)
21
 
22
  with torch.no_grad():
23
  image_features = model.encode_image(image_input)