diegulio commited on
Commit
bef6714
·
1 Parent(s): 32d2c97
Files changed (2) hide show
  1. cedula/app.py +2 -2
  2. license/app.py +2 -2
cedula/app.py CHANGED
@@ -105,7 +105,7 @@ def get_attributes(input_img):
105
  #images = check_image(input_img)
106
  images = [Image.fromarray(input_img)]
107
  images = crop(weights="best.pt", files= images)
108
- print(images)
109
  image_cedula = [img[0] for img in images if img[1]==0][0] #0 en 'img[1]==0' es el label de cedula, si se reemplaza por 1
110
  #entrega licencias
111
 
@@ -149,7 +149,7 @@ def create_model():
149
  input_image = gr.Image(source='upload', label='Input Image')
150
  submit = gr.Button("Submit")
151
  with gr.Column():
152
- output_text = gr.Textbox(label='Output Text')
153
 
154
  submit.click(fn=get_attributes,
155
  inputs=input_image,
 
105
  #images = check_image(input_img)
106
  images = [Image.fromarray(input_img)]
107
  images = crop(weights="best.pt", files= images)
108
+ #print(images)
109
  image_cedula = [img[0] for img in images if img[1]==0][0] #0 en 'img[1]==0' es el label de cedula, si se reemplaza por 1
110
  #entrega licencias
111
 
 
149
  input_image = gr.Image(source='upload', label='Input Image')
150
  submit = gr.Button("Submit")
151
  with gr.Column():
152
+ output_text = gr.JSON(label='Result')
153
 
154
  submit.click(fn=get_attributes,
155
  inputs=input_image,
license/app.py CHANGED
@@ -102,7 +102,7 @@ def get_attributes(input_img):
102
  model.eval()
103
  model.to(device)
104
 
105
- images = check_image(input_img)
106
  images = crop(weights="best.pt", files= images)
107
  image_cedula = [img[0] for img in images if img[1]==1][0] #0 en 'img[1]==0' es el label de cedula, si se reemplaza por 1
108
  #entrega licencias
@@ -141,7 +141,7 @@ def get_attributes(input_img):
141
  #demo.launch()
142
 
143
  def create_model():
144
- demo = gr.Interface(get_attributes, "image", "label")
145
  return demo
146
 
147
 
 
102
  model.eval()
103
  model.to(device)
104
 
105
+ images = [Image.fromarray(input_img)]
106
  images = crop(weights="best.pt", files= images)
107
  image_cedula = [img[0] for img in images if img[1]==1][0] #0 en 'img[1]==0' es el label de cedula, si se reemplaza por 1
108
  #entrega licencias
 
141
  #demo.launch()
142
 
143
  def create_model():
144
+ demo = gr.Interface(get_attributes, "image", "json")
145
  return demo
146
 
147