ysharma HF staff commited on
Commit
497205a
·
1 Parent(s): 5bb2709
Files changed (1) hide show
  1. gradio_seg2image.py +3 -2
gradio_seg2image.py CHANGED
@@ -10,8 +10,9 @@ import numpy as np
10
  import base64
11
 
12
  def encode(input_image):
 
13
  # Convert NumPy array to bytes
14
- img_bytes = np.ndarray.tobytes(img_array)
15
 
16
  # Encode the bytes using Base64
17
  encoded_string = base64.b64encode(img_bytes).decode('utf-8')
@@ -155,7 +156,7 @@ def create_demo(process, max_images=12):
155
  'longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality'
156
  )
157
  with gr.Column():
158
- result_gallery = gr.Gallery(label='Output', visible= False,
159
  show_label=False,
160
  elem_id='gallery').style(
161
  grid=2, height='auto')
 
10
  import base64
11
 
12
  def encode(input_image):
13
+ print(f"type of input_image ^^ - {type(input_image)}")
14
  # Convert NumPy array to bytes
15
+ img_bytes = np.ndarray.tobytes(input_image)
16
 
17
  # Encode the bytes using Base64
18
  encoded_string = base64.b64encode(img_bytes).decode('utf-8')
 
156
  'longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality'
157
  )
158
  with gr.Column():
159
+ result_gallery = gr.Gallery(label='Output', #visible= False,
160
  show_label=False,
161
  elem_id='gallery').style(
162
  grid=2, height='auto')