iakarshu commited on
Commit
3a73043
·
1 Parent(s): b8ad1bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -80,7 +80,7 @@ def answer_question(image, question):
80
  image.save('sample_img.png')
81
 
82
  # Extracting features from the image
83
- img, boxes, tokenized_words = create_features(image_path='sample_img.png',
84
  tokenizer=tokenizer,
85
  target_size=target_size,
86
  max_seq_length=max_seq_len,
@@ -105,7 +105,7 @@ def answer_question(image, question):
105
  ## Tensor tokenized words
106
  tokenized_words = torch.as_tensor(tokenized_words, dtype=torch.int32)
107
 
108
- img = transforms.ToTensor()(img)
109
  question = convert_ques_to_token(question = question, tokenizer = tokenizer)
110
 
111
  ## Expanding the dimension for inference
 
80
  image.save('sample_img.png')
81
 
82
  # Extracting features from the image
83
+ img boxes, tokenized_words = create_features(image_path='sample_img.png',
84
  tokenizer=tokenizer,
85
  target_size=target_size,
86
  max_seq_length=max_seq_len,
 
105
  ## Tensor tokenized words
106
  tokenized_words = torch.as_tensor(tokenized_words, dtype=torch.int32)
107
 
108
+ img = transforms.ToTensor()(image)
109
  question = convert_ques_to_token(question = question, tokenizer = tokenizer)
110
 
111
  ## Expanding the dimension for inference