Update app.py
Browse files
app.py
CHANGED
|
@@ -809,7 +809,7 @@ with gr.Blocks(title="Salamandra Vision 7B 路 ZeroGPU", css=custom_css) as demo:
|
|
| 809 |
batch_context = gr.Textbox(label="context_json", value="{}", lines=4)
|
| 810 |
batch_max = gr.Slider(16, 1024, value=256, step=16, label="m脿x_tokens nous")
|
| 811 |
batch_temp = gr.Slider(0.0, 1.5, value=0.7, step=0.05, label="temperatura")
|
| 812 |
-
batch_btn = gr.Button("Descriu el lot")
|
| 813 |
batch_out = gr.JSON(label="Descripcions (llista)")
|
| 814 |
|
| 815 |
batch_btn.click(
|
|
@@ -827,7 +827,7 @@ with gr.Blocks(title="Salamandra Vision 7B 路 ZeroGPU", css=custom_css) as demo:
|
|
| 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")
|
| 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 +841,7 @@ with gr.Blocks(title="Salamandra Vision 7B 路 ZeroGPU", css=custom_css) as demo:
|
|
| 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")
|
| 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 +860,7 @@ with gr.Blocks(title="Salamandra Vision 7B 路 ZeroGPU", css=custom_css) as demo:
|
|
| 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")
|
| 864 |
desc_output = gr.Textbox(label="Descripcions de les imatges")
|
| 865 |
|
| 866 |
describe_btn.click(
|
|
@@ -888,7 +888,7 @@ with gr.Blocks(title="Salamandra Vision 7B 路 ZeroGPU", css=custom_css) as demo:
|
|
| 888 |
placeholder='[{"nombre": "Anna", "embedding": [0.12, 0.88, ...]}, ...]',
|
| 889 |
lines=5
|
| 890 |
)
|
| 891 |
-
process_btn = gr.Button("Processar imatge (OCR + Persones)")
|
| 892 |
output_json = gr.JSON(label="Resultat complet")
|
| 893 |
|
| 894 |
process_btn.click(
|
|
|
|
| 809 |
batch_context = gr.Textbox(label="context_json", value="{}", lines=4)
|
| 810 |
batch_max = gr.Slider(16, 1024, value=256, step=16, label="m脿x_tokens nous")
|
| 811 |
batch_temp = gr.Slider(0.0, 1.5, value=0.7, step=0.05, label="temperatura")
|
| 812 |
+
batch_btn = gr.Button("Descriu el lot", variant="primary")
|
| 813 |
batch_out = gr.JSON(label="Descripcions (llista)")
|
| 814 |
|
| 815 |
batch_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 |
+
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 |
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 |
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(
|
|
|
|
| 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(
|