VeuReu commited on
Commit
e3b4a4b
verified
1 Parent(s): 18a1aa4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -827,7 +827,9 @@ with gr.Blocks(title="Salamandra Vision 7B 路 ZeroGPU", css=custom_css,theme=gr.
827
  gr.Markdown('<h2 style="text-align:center">Embeddings facials</h2>')
828
  with gr.Row():
829
  face_img = gr.Image(label="Imatge per embedding facial", type="pil")
 
830
  face_btn = gr.Button("Obt茅 embedding facial", variant="primary")
 
831
  face_out = gr.JSON(label="Embedding facial (vector)")
832
  face_btn.click(face_image_embedding, [face_img], face_out, api_name="face_image_embedding", concurrency_limit=1)
833
  gr.Markdown("---")
@@ -841,7 +843,9 @@ with gr.Blocks(title="Salamandra Vision 7B 路 ZeroGPU", css=custom_css,theme=gr.
841
  threshold = gr.Slider(0.0, 100.0, value=30.0, step=1.0, label="Llindar")
842
  offset_frames = gr.Slider(0, 30, value=5, step=1, label="Despla莽ament de frames")
843
  crop_ratio = gr.Slider(0.0, 1.0, value=1.0, step=0.05, label="Ra贸 de retall")
 
844
  scenes_btn = gr.Button("Extreu escenes", variant="primary")
 
845
  scenes_gallery_out = gr.Gallery(label="Fotogrames clau de l鈥檈scena", show_label=False, columns=4, height="auto")
846
  scenes_info_out = gr.JSON(label="Informaci贸 de l鈥檈scena")
847
 
@@ -860,7 +864,9 @@ with gr.Blocks(title="Salamandra Vision 7B 路 ZeroGPU", css=custom_css,theme=gr.
860
  gr.Markdown('<h2 style="text-align:center">Descripci贸 per lots amb Salamandra Vision</h2>')
861
  with gr.Row():
862
  img_input = gr.Gallery(label="Llot d鈥檌matges", show_label=False)
 
863
  describe_btn = gr.Button("Genera descripcions", variant="primary")
 
864
  desc_output = gr.Textbox(label="Descripcions de les imatges")
865
 
866
  describe_btn.click(
@@ -883,12 +889,15 @@ with gr.Blocks(title="Salamandra Vision 7B 路 ZeroGPU", css=custom_css,theme=gr.
883
  placeholder='{"index": 0, "start": 0.0, "end": 1.2}',
884
  lines=3
885
  )
 
886
  faces_input = gr.Textbox(
887
  label="Llistat de diccionaris face_col (format JSON)",
888
  placeholder='[{"nombre": "Anna", "embedding": [0.12, 0.88, ...]}, ...]',
889
  lines=5
890
  )
 
891
  process_btn = gr.Button("Processar imatge (OCR + Persones)", variant="primary")
 
892
  output_json = gr.JSON(label="Resultat complet")
893
 
894
  process_btn.click(
 
827
  gr.Markdown('<h2 style="text-align:center">Embeddings facials</h2>')
828
  with gr.Row():
829
  face_img = gr.Image(label="Imatge per embedding facial", type="pil")
830
+ with gr.Row():
831
  face_btn = gr.Button("Obt茅 embedding facial", variant="primary")
832
+ with gr.Row():
833
  face_out = gr.JSON(label="Embedding facial (vector)")
834
  face_btn.click(face_image_embedding, [face_img], face_out, api_name="face_image_embedding", concurrency_limit=1)
835
  gr.Markdown("---")
 
843
  threshold = gr.Slider(0.0, 100.0, value=30.0, step=1.0, label="Llindar")
844
  offset_frames = gr.Slider(0, 30, value=5, step=1, label="Despla莽ament de frames")
845
  crop_ratio = gr.Slider(0.0, 1.0, value=1.0, step=0.05, label="Ra贸 de retall")
846
+ with gr.Row():
847
  scenes_btn = gr.Button("Extreu escenes", variant="primary")
848
+ with gr.Row():
849
  scenes_gallery_out = gr.Gallery(label="Fotogrames clau de l鈥檈scena", show_label=False, columns=4, height="auto")
850
  scenes_info_out = gr.JSON(label="Informaci贸 de l鈥檈scena")
851
 
 
864
  gr.Markdown('<h2 style="text-align:center">Descripci贸 per lots amb Salamandra Vision</h2>')
865
  with gr.Row():
866
  img_input = gr.Gallery(label="Llot d鈥檌matges", show_label=False)
867
+ with gr.Row():
868
  describe_btn = gr.Button("Genera descripcions", variant="primary")
869
+ with gr.Row():
870
  desc_output = gr.Textbox(label="Descripcions de les imatges")
871
 
872
  describe_btn.click(
 
889
  placeholder='{"index": 0, "start": 0.0, "end": 1.2}',
890
  lines=3
891
  )
892
+ with gr.Row():
893
  faces_input = gr.Textbox(
894
  label="Llistat de diccionaris face_col (format JSON)",
895
  placeholder='[{"nombre": "Anna", "embedding": [0.12, 0.88, ...]}, ...]',
896
  lines=5
897
  )
898
+ with gr.Row():
899
  process_btn = gr.Button("Processar imatge (OCR + Persones)", variant="primary")
900
+ with gr.Row():
901
  output_json = gr.JSON(label="Resultat complet")
902
 
903
  process_btn.click(