wiusdy commited on
Commit
aa6bf48
1 Parent(s): 67cf203
Files changed (2) hide show
  1. app.py +1 -0
  2. inference.py +1 -1
app.py CHANGED
@@ -15,6 +15,7 @@ with gr.Blocks() as block:
15
  btn = gr.Button(value="Submit")
16
 
17
  frame = os.path.join(os.path.dirname(__file__), "testing.jpg")
 
18
  image = gr.Image(type="pil", value=frame)
19
 
20
  btn.click(inference.inference, inputs=[options, image, txt], outputs=[txt_3])
 
15
  btn = gr.Button(value="Submit")
16
 
17
  frame = os.path.join(os.path.dirname(__file__), "testing.jpg")
18
+ inference.logger.info(f"Image loaded {frame.shape}")
19
  image = gr.Image(type="pil", value=frame)
20
 
21
  btn.click(inference.inference, inputs=[options, image, txt], outputs=[txt_3])
inference.py CHANGED
@@ -10,7 +10,7 @@ class Inference:
10
  self.logger = logging.get_logger("transformers")
11
 
12
  def inference(self, selected, image, text):
13
- self.logger.info(f"selected model {selected}, image shape {image.data}, question {text.value}")
14
  if selected == "Blip Saffal":
15
  return self.__inference_saffal_blip(image, text)
16
  elif selected == "Blip CN":
 
10
  self.logger = logging.get_logger("transformers")
11
 
12
  def inference(self, selected, image, text):
13
+ self.logger.info(f"selected model {selected}, question {text.value}")
14
  if selected == "Blip Saffal":
15
  return self.__inference_saffal_blip(image, text)
16
  elif selected == "Blip CN":