Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- Dockerfile +12 -0
- README.md +6 -6
- __init__.py +0 -0
- __pycache__/app.cpython-311.pyc +0 -0
- app.py +12 -0
- requirements.txt +1 -0
- src/.gitignore +9 -0
- src/README.md +10 -0
- src/backend/gradio_videogallery/__init__.py +4 -0
- src/backend/gradio_videogallery/templates/component/index.js +0 -0
- src/backend/gradio_videogallery/templates/component/style.css +1 -0
- src/backend/gradio_videogallery/videogallery.py +183 -0
- src/backend/gradio_videogallery/videogallery.pyi +221 -0
- src/demo/__init__.py +0 -0
- src/demo/app.py +12 -0
- src/frontend/Index.svelte +90 -0
- src/frontend/package-lock.json +1047 -0
- src/frontend/package.json +25 -0
- src/frontend/shared/Gallery.svelte +509 -0
- src/frontend/shared/utils.ts +18 -0
- src/pyproject.toml +49 -0
Dockerfile
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
FROM python:3.9
|
3 |
+
|
4 |
+
WORKDIR /code
|
5 |
+
|
6 |
+
COPY --link --chown=1000 . .
|
7 |
+
|
8 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
9 |
+
|
10 |
+
ENV PYTHONUNBUFFERED=1 GRADIO_ALLOW_FLAGGING=never GRADIO_NUM_PORTS=1 GRADIO_SERVER_NAME=0.0.0.0 GRADIO_SERVER_PORT=7860 SYSTEM=spaces
|
11 |
+
|
12 |
+
CMD ["python", "app.py"]
|
README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
|
|
1 |
---
|
2 |
-
|
3 |
-
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: docker
|
7 |
pinned: false
|
|
|
8 |
---
|
9 |
-
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
+
|
2 |
---
|
3 |
+
tags: [gradio-custom-component, gradio-template-Gallery]
|
4 |
+
title: gradio_videogallery V0.0.1
|
5 |
+
colorFrom: green
|
6 |
+
colorTo: pink
|
7 |
sdk: docker
|
8 |
pinned: false
|
9 |
+
license: apache-2.0
|
10 |
---
|
|
|
|
__init__.py
ADDED
File without changes
|
__pycache__/app.cpython-311.pyc
ADDED
Binary file (958 Bytes). View file
|
|
app.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
import gradio as gr
|
3 |
+
from gradio_videogallery import videogallery
|
4 |
+
|
5 |
+
|
6 |
+
example = videogallery().example_inputs()
|
7 |
+
|
8 |
+
with gr.Blocks() as demo:
|
9 |
+
with gr.Row():
|
10 |
+
videogallery(value=example, label="Populated"), # populated component
|
11 |
+
|
12 |
+
demo.launch()
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
gradio_videogallery-0.0.1-py3-none-any.whl
|
src/.gitignore
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.eggs/
|
2 |
+
dist/
|
3 |
+
*.pyc
|
4 |
+
__pycache__/
|
5 |
+
*.py[cod]
|
6 |
+
*$py.class
|
7 |
+
__tmp/*
|
8 |
+
*.pyi
|
9 |
+
node_modules
|
src/README.md
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
# gradio_videogallery
|
3 |
+
A Custom Gradio component.
|
4 |
+
|
5 |
+
## Example usage
|
6 |
+
|
7 |
+
```python
|
8 |
+
import gradio as gr
|
9 |
+
from gradio_videogallery import videogallery
|
10 |
+
```
|
src/backend/gradio_videogallery/__init__.py
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
from .videogallery import videogallery
|
3 |
+
|
4 |
+
__all__ = ['videogallery']
|
src/backend/gradio_videogallery/templates/component/index.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
src/backend/gradio_videogallery/templates/component/style.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.block.svelte-1t38q2d{position:relative;margin:0;box-shadow:var(--block-shadow);border-width:var(--block-border-width);border-color:var(--block-border-color);border-radius:var(--block-radius);background:var(--block-background-fill);width:100%;line-height:var(--line-sm)}.block.border_focus.svelte-1t38q2d{border-color:var(--color-accent)}.padded.svelte-1t38q2d{padding:var(--block-padding)}.hidden.svelte-1t38q2d{display:none}.hide-container.svelte-1t38q2d{margin:0;box-shadow:none;--block-border-width:0;background:transparent;padding:0;overflow:visible}div.svelte-1hnfib2{margin-bottom:var(--spacing-lg);color:var(--block-info-text-color);font-weight:var(--block-info-text-weight);font-size:var(--block-info-text-size);line-height:var(--line-sm)}span.has-info.svelte-22c38v{margin-bottom:var(--spacing-xs)}span.svelte-22c38v:not(.has-info){margin-bottom:var(--spacing-lg)}span.svelte-22c38v{display:inline-block;position:relative;z-index:var(--layer-4);border:solid var(--block-title-border-width) var(--block-title-border-color);border-radius:var(--block-title-radius);background:var(--block-title-background-fill);padding:var(--block-title-padding);color:var(--block-title-text-color);font-weight:var(--block-title-text-weight);font-size:var(--block-title-text-size);line-height:var(--line-sm)}.hide.svelte-22c38v{margin:0;height:0}label.svelte-9gxdi0{display:inline-flex;align-items:center;z-index:var(--layer-2);box-shadow:var(--block-label-shadow);border:var(--block-label-border-width) solid var(--border-color-primary);border-top:none;border-left:none;border-radius:var(--block-label-radius);background:var(--block-label-background-fill);padding:var(--block-label-padding);pointer-events:none;color:var(--block-label-text-color);font-weight:var(--block-label-text-weight);font-size:var(--block-label-text-size);line-height:var(--line-sm)}.gr-group label.svelte-9gxdi0{border-top-left-radius:0}label.float.svelte-9gxdi0{position:absolute;top:var(--block-label-margin);left:var(--block-label-margin)}label.svelte-9gxdi0:not(.float){position:static;margin-top:var(--block-label-margin);margin-left:var(--block-label-margin)}.hide.svelte-9gxdi0{height:0}span.svelte-9gxdi0{opacity:.8;margin-right:var(--size-2);width:calc(var(--block-label-text-size) - 1px);height:calc(var(--block-label-text-size) - 1px)}.hide-label.svelte-9gxdi0{box-shadow:none;border-width:0;background:transparent;overflow:visible}button.svelte-xtz2g8{display:flex;justify-content:center;align-items:center;gap:1px;z-index:var(--layer-2);border-radius:var(--radius-sm);color:var(--block-label-text-color);border:1px solid transparent}.padded.svelte-xtz2g8{padding:2px;background:var(--background-fill-primary);box-shadow:var(--shadow-drop);border:1px solid var(--button-secondary-border-color)}button.svelte-xtz2g8:hover{cursor:pointer;color:var(--color-accent)}.padded.svelte-xtz2g8:hover{border:2px solid var(--button-secondary-border-color-hover);padding:1px;color:var(--block-label-text-color)}span.svelte-xtz2g8{padding:0 1px;font-size:10px}div.svelte-xtz2g8{padding:2px;display:flex;align-items:flex-end}.small.svelte-xtz2g8{width:14px;height:14px}.large.svelte-xtz2g8{width:22px;height:22px}.pending.svelte-xtz2g8{animation:svelte-xtz2g8-flash .5s infinite}@keyframes svelte-xtz2g8-flash{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}.empty.svelte-3w3rth{display:flex;justify-content:center;align-items:center;margin-top:calc(0px - var(--size-6));height:var(--size-full)}.icon.svelte-3w3rth{opacity:.5;height:var(--size-5);color:var(--body-text-color)}.small.svelte-3w3rth{min-height:calc(var(--size-32) - 20px)}.large.svelte-3w3rth{min-height:calc(var(--size-64) - 20px)}.unpadded_box.svelte-3w3rth{margin-top:0}.small_parent.svelte-3w3rth{min-height:100%!important}.dropdown-arrow.svelte-145leq6{fill:currentColor}.wrap.svelte-kzcjhc{display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:var(--size-60);color:var(--block-label-text-color);line-height:var(--line-md);height:100%;padding-top:var(--size-3)}.or.svelte-kzcjhc{color:var(--body-text-color-subdued);display:flex}.icon-wrap.svelte-kzcjhc{width:30px;margin-bottom:var(--spacing-lg)}@media (--screen-md){.wrap.svelte-kzcjhc{font-size:var(--text-lg)}}.hovered.svelte-kzcjhc{color:var(--color-accent)}div.svelte-1nba87b{border-top:1px solid transparent;display:flex;max-height:100%;justify-content:center;gap:var(--spacing-sm);height:auto;align-items:flex-end;box-shadow:var(--shadow-drop);padding:var(--spacing-xl) 0;color:var(--block-label-text-color);flex-shrink:0;width:95%}.show_border.svelte-1nba87b{border-top:1px solid var(--block-border-color);margin-top:var(--spacing-xxl)}.source-selection.svelte-lde7lt{display:flex;align-items:center;justify-content:center;border-top:1px solid var(--border-color-primary);width:95%;bottom:0;left:0;right:0;margin-left:auto;margin-right:auto;align-self:flex-end}.icon.svelte-lde7lt{width:22px;height:22px;margin:var(--spacing-lg) var(--spacing-xs);padding:var(--spacing-xs);color:var(--neutral-400);border-radius:var(--radius-md)}.selected.svelte-lde7lt{color:var(--color-accent)}.icon.svelte-lde7lt:hover,.icon.svelte-lde7lt:focus{color:var(--color-accent)}button.svelte-a356bc{cursor:pointer;width:var(--size-full)}.hidden.svelte-a356bc{display:none;height:0;position:absolute}.center.svelte-a356bc{display:flex;justify-content:center}.flex.svelte-a356bc{display:flex;justify-content:center;align-items:center}input.svelte-a356bc{display:none}div.svelte-1wj0ocy{display:flex;top:var(--size-2);right:var(--size-2);justify-content:flex-end;gap:var(--spacing-sm);z-index:var(--layer-1)}.not-absolute.svelte-1wj0ocy{margin:var(--size-1)}.preview.svelte-1wl86it.svelte-1wl86it{display:flex;position:absolute;top:0;right:0;bottom:0;left:0;flex-direction:column;z-index:var(--layer-2);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:var(--background-fill-primary);height:var(--size-full)}.fixed-height.svelte-1wl86it.svelte-1wl86it{min-height:var(--size-80);max-height:55vh}@media (--screen-xl){.fixed-height.svelte-1wl86it.svelte-1wl86it{min-height:450px}}.detailed-video.svelte-1wl86it.svelte-1wl86it,.image-button.svelte-1wl86it.svelte-1wl86it{height:calc(100% - 60px);width:100%;display:flex}.preview.svelte-1wl86it img.svelte-1wl86it{width:var(--size-full);height:var(--size-full);object-fit:contain}.preview.svelte-1wl86it img.with-caption.svelte-1wl86it{height:var(--size-full)}.caption.svelte-1wl86it.svelte-1wl86it{padding:var(--size-2) var(--size-3);overflow:hidden;color:var(--block-label-text-color);font-weight:var(--weight-semibold);text-align:center;text-overflow:ellipsis;white-space:nowrap;align-self:center}.thumbnails.svelte-1wl86it.svelte-1wl86it{display:flex;position:absolute;bottom:0;justify-content:center;align-items:center;gap:var(--spacing-lg);width:var(--size-full);height:var(--size-14);overflow-x:scroll}.thumbnail-item.svelte-1wl86it.svelte-1wl86it{--ring-color:transparent;position:relative;box-shadow:0 0 0 2px var(--ring-color),var(--shadow-drop);border:1px solid var(--border-color-primary);border-radius:var(--button-small-radius);background:var(--background-fill-secondary);aspect-ratio:var(--ratio-square);width:var(--size-full);height:var(--size-full);overflow:clip}.thumbnail-item.svelte-1wl86it.svelte-1wl86it:hover{--ring-color:var(--color-accent);filter:brightness(1.1)}.thumbnail-item.selected.svelte-1wl86it.svelte-1wl86it{--ring-color:var(--color-accent)}.thumbnail-small.svelte-1wl86it.svelte-1wl86it{flex:none;transform:scale(.9);transition:75ms;width:var(--size-9);height:var(--size-9)}.thumbnail-small.selected.svelte-1wl86it.svelte-1wl86it{--ring-color:var(--color-accent);transform:scale(1);border-color:var(--color-accent)}.thumbnail-small.svelte-1wl86it>img.svelte-1wl86it{width:var(--size-full);height:var(--size-full);overflow:hidden;object-fit:var(--object-fit)}.grid-wrap.svelte-1wl86it.svelte-1wl86it{position:relative;padding:var(--size-2);height:var(--size-full);overflow-y:scroll}.grid-container.svelte-1wl86it.svelte-1wl86it{display:grid;position:relative;grid-template-rows:repeat(var(--grid-rows),minmax(100px,1fr));grid-template-columns:repeat(var(--grid-cols),minmax(100px,1fr));grid-auto-rows:minmax(100px,1fr);gap:var(--spacing-lg)}.thumbnail-lg.svelte-1wl86it>img.svelte-1wl86it{width:var(--size-full);height:var(--size-full);overflow:hidden;object-fit:var(--object-fit)}.thumbnail-lg.svelte-1wl86it:hover .caption-label.svelte-1wl86it{opacity:.5}.caption-label.svelte-1wl86it.svelte-1wl86it{position:absolute;right:var(--block-label-margin);bottom:var(--block-label-margin);z-index:var(--layer-1);border-top:1px solid var(--border-color-primary);border-left:1px solid var(--border-color-primary);border-radius:var(--block-label-radius);background:var(--background-fill-secondary);padding:var(--block-label-padding);max-width:80%;overflow:hidden;font-size:var(--block-label-text-size);text-align:left;text-overflow:ellipsis;white-space:nowrap}.icon-button.svelte-1wl86it.svelte-1wl86it{position:absolute;top:0;right:0;z-index:var(--layer-1)}.icon-buttons.svelte-1wl86it.svelte-1wl86it{display:flex;position:absolute;right:0}.icon-buttons.svelte-1wl86it a.svelte-1wl86it{margin:var(--size-1) 0}svg.svelte-43sxxs.svelte-43sxxs{width:var(--size-20);height:var(--size-20)}svg.svelte-43sxxs path.svelte-43sxxs{fill:var(--loader-color)}div.svelte-43sxxs.svelte-43sxxs{z-index:var(--layer-2)}.margin.svelte-43sxxs.svelte-43sxxs{margin:var(--size-4)}.wrap.svelte-14miwb5.svelte-14miwb5{display:flex;flex-direction:column;justify-content:center;align-items:center;z-index:var(--layer-5);transition:opacity .1s ease-in-out;border-radius:var(--block-radius);background:var(--block-background-fill);padding:0 var(--size-6);max-height:var(--size-screen-h);overflow:hidden;pointer-events:none}.wrap.center.svelte-14miwb5.svelte-14miwb5{top:0;right:0;left:0}.wrap.default.svelte-14miwb5.svelte-14miwb5{top:0;right:0;bottom:0;left:0}.hide.svelte-14miwb5.svelte-14miwb5{opacity:0;pointer-events:none}.generating.svelte-14miwb5.svelte-14miwb5{animation:svelte-14miwb5-pulse 2s cubic-bezier(.4,0,.6,1) infinite;border:2px solid var(--color-accent);background:transparent}.translucent.svelte-14miwb5.svelte-14miwb5{background:none}@keyframes svelte-14miwb5-pulse{0%,to{opacity:1}50%{opacity:.5}}.loading.svelte-14miwb5.svelte-14miwb5{z-index:var(--layer-2);color:var(--body-text-color)}.eta-bar.svelte-14miwb5.svelte-14miwb5{position:absolute;top:0;right:0;bottom:0;left:0;transform-origin:left;opacity:.8;z-index:var(--layer-1);transition:10ms;background:var(--background-fill-secondary)}.progress-bar-wrap.svelte-14miwb5.svelte-14miwb5{border:1px solid var(--border-color-primary);background:var(--background-fill-primary);width:55.5%;height:var(--size-4)}.progress-bar.svelte-14miwb5.svelte-14miwb5{transform-origin:left;background-color:var(--loader-color);width:var(--size-full);height:var(--size-full)}.progress-level.svelte-14miwb5.svelte-14miwb5{display:flex;flex-direction:column;align-items:center;gap:1;z-index:var(--layer-2);width:var(--size-full)}.progress-level-inner.svelte-14miwb5.svelte-14miwb5{margin:var(--size-2) auto;color:var(--body-text-color);font-size:var(--text-sm);font-family:var(--font-mono)}.meta-text.svelte-14miwb5.svelte-14miwb5{position:absolute;top:0;right:0;z-index:var(--layer-2);padding:var(--size-1) var(--size-2);font-size:var(--text-sm);font-family:var(--font-mono)}.meta-text-center.svelte-14miwb5.svelte-14miwb5{display:flex;position:absolute;top:0;right:0;justify-content:center;align-items:center;transform:translateY(var(--size-6));z-index:var(--layer-2);padding:var(--size-1) var(--size-2);font-size:var(--text-sm);font-family:var(--font-mono);text-align:center}.error.svelte-14miwb5.svelte-14miwb5{box-shadow:var(--shadow-drop);border:solid 1px var(--error-border-color);border-radius:var(--radius-full);background:var(--error-background-fill);padding-right:var(--size-4);padding-left:var(--size-4);color:var(--error-text-color);font-weight:var(--weight-semibold);font-size:var(--text-lg);line-height:var(--line-lg);font-family:var(--font)}.minimal.svelte-14miwb5 .progress-text.svelte-14miwb5{background:var(--block-background-fill)}.border.svelte-14miwb5.svelte-14miwb5{border:1px solid var(--border-color-primary)}.toast-body.svelte-solcu7{display:flex;position:relative;right:0;left:0;align-items:center;margin:var(--size-6) var(--size-4);margin:auto;border-radius:var(--container-radius);overflow:hidden;pointer-events:auto}.toast-body.error.svelte-solcu7{border:1px solid var(--color-red-700);background:var(--color-red-50)}.dark .toast-body.error.svelte-solcu7{border:1px solid var(--color-red-500);background-color:var(--color-grey-950)}.toast-body.warning.svelte-solcu7{border:1px solid var(--color-yellow-700);background:var(--color-yellow-50)}.dark .toast-body.warning.svelte-solcu7{border:1px solid var(--color-yellow-500);background-color:var(--color-grey-950)}.toast-body.info.svelte-solcu7{border:1px solid var(--color-grey-700);background:var(--color-grey-50)}.dark .toast-body.info.svelte-solcu7{border:1px solid var(--color-grey-500);background-color:var(--color-grey-950)}.toast-title.svelte-solcu7{display:flex;align-items:center;font-weight:var(--weight-bold);font-size:var(--text-lg);line-height:var(--line-sm);text-transform:capitalize}.toast-title.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-title.error.svelte-solcu7{color:var(--color-red-50)}.toast-title.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-title.warning.svelte-solcu7{color:var(--color-yellow-50)}.toast-title.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-title.info.svelte-solcu7{color:var(--color-grey-50)}.toast-close.svelte-solcu7{margin:0 var(--size-3);border-radius:var(--size-3);padding:0px var(--size-1-5);font-size:var(--size-5);line-height:var(--size-5)}.toast-close.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-close.error.svelte-solcu7{color:var(--color-red-500)}.toast-close.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-close.warning.svelte-solcu7{color:var(--color-yellow-500)}.toast-close.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-close.info.svelte-solcu7{color:var(--color-grey-500)}.toast-text.svelte-solcu7{font-size:var(--text-lg)}.toast-text.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-text.error.svelte-solcu7{color:var(--color-red-50)}.toast-text.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-text.warning.svelte-solcu7{color:var(--color-yellow-50)}.toast-text.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-text.info.svelte-solcu7{color:var(--color-grey-50)}.toast-details.svelte-solcu7{margin:var(--size-3) var(--size-3) var(--size-3) 0;width:100%}.toast-icon.svelte-solcu7{display:flex;position:absolute;position:relative;flex-shrink:0;justify-content:center;align-items:center;margin:var(--size-2);border-radius:var(--radius-full);padding:var(--size-1);padding-left:calc(var(--size-1) - 1px);width:35px;height:35px}.toast-icon.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-icon.error.svelte-solcu7{color:var(--color-red-500)}.toast-icon.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-icon.warning.svelte-solcu7{color:var(--color-yellow-500)}.toast-icon.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-icon.info.svelte-solcu7{color:var(--color-grey-500)}@keyframes svelte-solcu7-countdown{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.timer.svelte-solcu7{position:absolute;bottom:0;left:0;transform-origin:0 0;animation:svelte-solcu7-countdown 10s linear forwards;width:100%;height:var(--size-1)}.timer.error.svelte-solcu7{background:var(--color-red-700)}.dark .timer.error.svelte-solcu7{background:var(--color-red-500)}.timer.warning.svelte-solcu7{background:var(--color-yellow-700)}.dark .timer.warning.svelte-solcu7{background:var(--color-yellow-500)}.timer.info.svelte-solcu7{background:var(--color-grey-700)}.dark .timer.info.svelte-solcu7{background:var(--color-grey-500)}.toast-wrap.svelte-gatr8h{display:flex;position:fixed;top:var(--size-4);right:var(--size-4);flex-direction:column;align-items:end;gap:var(--size-2);z-index:var(--layer-top);width:calc(100% - var(--size-8))}@media (--screen-sm){.toast-wrap.svelte-gatr8h{width:calc(var(--size-96) + var(--size-10))}}
|
src/backend/gradio_videogallery/videogallery.py
ADDED
@@ -0,0 +1,183 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""gr.Gallery() component."""
|
2 |
+
|
3 |
+
from __future__ import annotations
|
4 |
+
|
5 |
+
from pathlib import Path
|
6 |
+
from typing import Any, Callable, List, Literal, Optional
|
7 |
+
|
8 |
+
import numpy as np
|
9 |
+
from gradio_client.documentation import document, set_documentation_group
|
10 |
+
from gradio_client import utils as client_utils
|
11 |
+
from gradio_client.utils import is_http_url_like
|
12 |
+
from PIL import Image as _Image # using _ to minimize namespace pollution
|
13 |
+
|
14 |
+
from gradio import processing_utils, utils
|
15 |
+
from gradio.components.base import Component
|
16 |
+
from gradio.data_classes import FileData, GradioModel, GradioRootModel
|
17 |
+
from gradio.events import Events
|
18 |
+
|
19 |
+
set_documentation_group("component")
|
20 |
+
|
21 |
+
|
22 |
+
class GalleryImage(GradioModel):
|
23 |
+
image: FileData
|
24 |
+
caption: Optional[str] = None
|
25 |
+
|
26 |
+
|
27 |
+
class GalleryData(GradioRootModel):
|
28 |
+
root: List[GalleryImage]
|
29 |
+
|
30 |
+
|
31 |
+
@document()
|
32 |
+
class videogallery(Component):
|
33 |
+
"""
|
34 |
+
Used to display a list of images as a gallery that can be scrolled through.
|
35 |
+
Preprocessing: this component does *not* accept input.
|
36 |
+
Postprocessing: expects a list of images in any format, {List[numpy.array | PIL.Image | str | pathlib.Path]}, or a {List} of (image, {str} caption) tuples and displays them.
|
37 |
+
|
38 |
+
Demos: fake_gan
|
39 |
+
"""
|
40 |
+
|
41 |
+
EVENTS = [Events.select]
|
42 |
+
|
43 |
+
data_model = GalleryData
|
44 |
+
|
45 |
+
def __init__(
|
46 |
+
self,
|
47 |
+
value: list[np.ndarray | _Image.Image | str | Path | tuple]
|
48 |
+
| Callable
|
49 |
+
| None = None,
|
50 |
+
*,
|
51 |
+
label: str | None = None,
|
52 |
+
every: float | None = None,
|
53 |
+
show_label: bool | None = None,
|
54 |
+
container: bool = True,
|
55 |
+
scale: int | None = None,
|
56 |
+
min_width: int = 160,
|
57 |
+
visible: bool = True,
|
58 |
+
elem_id: str | None = None,
|
59 |
+
elem_classes: list[str] | str | None = None,
|
60 |
+
render: bool = True,
|
61 |
+
columns: int | tuple | None = 2,
|
62 |
+
rows: int | tuple | None = None,
|
63 |
+
height: int | float | None = None,
|
64 |
+
allow_preview: bool = True,
|
65 |
+
preview: bool | None = None,
|
66 |
+
selected_index: int | None = None,
|
67 |
+
object_fit: Literal["contain", "cover", "fill", "none", "scale-down"]
|
68 |
+
| None = None,
|
69 |
+
show_share_button: bool | None = None,
|
70 |
+
show_download_button: bool | None = True,
|
71 |
+
):
|
72 |
+
"""
|
73 |
+
Parameters:
|
74 |
+
value: List of images to display in the gallery by default. If callable, the function will be called whenever the app loads to set the initial value of the component.
|
75 |
+
label: The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.
|
76 |
+
every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.
|
77 |
+
show_label: if True, will display label.
|
78 |
+
container: If True, will place the component in a container - providing some extra padding around the border.
|
79 |
+
scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer.
|
80 |
+
min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.
|
81 |
+
visible: If False, component will be hidden.
|
82 |
+
elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
|
83 |
+
elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.
|
84 |
+
render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
|
85 |
+
columns: Represents the number of images that should be shown in one row, for each of the six standard screen sizes (<576px, <768px, <992px, <1200px, <1400px, >1400px). If fewer than 6 are given then the last will be used for all subsequent breakpoints
|
86 |
+
rows: Represents the number of rows in the image grid, for each of the six standard screen sizes (<576px, <768px, <992px, <1200px, <1400px, >1400px). If fewer than 6 are given then the last will be used for all subsequent breakpoints
|
87 |
+
height: The height of the gallery component, in pixels. If more images are displayed than can fit in the height, a scrollbar will appear.
|
88 |
+
allow_preview: If True, images in the gallery will be enlarged when they are clicked. Default is True.
|
89 |
+
preview: If True, videogallery will start in preview mode, which shows all of the images as thumbnails and allows the user to click on them to view them in full size. Only works if allow_preview is True.
|
90 |
+
selected_index: The index of the image that should be initially selected. If None, no image will be selected at start. If provided, will set videogallery to preview mode unless allow_preview is set to False.
|
91 |
+
object_fit: CSS object-fit property for the thumbnail images in the gallery. Can be "contain", "cover", "fill", "none", or "scale-down".
|
92 |
+
show_share_button: If True, will show a share icon in the corner of the component that allows user to share outputs to Hugging Face Spaces Discussions. If False, icon does not appear. If set to None (default behavior), then the icon appears if this Gradio app is launched on Spaces, but not otherwise.
|
93 |
+
show_download_button: If True, will show a download button in the corner of the selected image. If False, the icon does not appear. Default is True.
|
94 |
+
"""
|
95 |
+
self.columns = columns
|
96 |
+
self.rows = rows
|
97 |
+
self.height = height
|
98 |
+
self.preview = preview
|
99 |
+
self.object_fit = object_fit
|
100 |
+
self.allow_preview = allow_preview
|
101 |
+
self.show_download_button = (
|
102 |
+
(utils.get_space() is not None)
|
103 |
+
if show_download_button is None
|
104 |
+
else show_download_button
|
105 |
+
)
|
106 |
+
self.selected_index = selected_index
|
107 |
+
|
108 |
+
self.show_share_button = (
|
109 |
+
(utils.get_space() is not None)
|
110 |
+
if show_share_button is None
|
111 |
+
else show_share_button
|
112 |
+
)
|
113 |
+
super().__init__(
|
114 |
+
label=label,
|
115 |
+
every=every,
|
116 |
+
show_label=show_label,
|
117 |
+
container=container,
|
118 |
+
scale=scale,
|
119 |
+
min_width=min_width,
|
120 |
+
visible=visible,
|
121 |
+
elem_id=elem_id,
|
122 |
+
elem_classes=elem_classes,
|
123 |
+
render=render,
|
124 |
+
value=value,
|
125 |
+
)
|
126 |
+
|
127 |
+
def postprocess(
|
128 |
+
self,
|
129 |
+
value: list[np.ndarray | _Image.Image | str | Path]
|
130 |
+
| list[tuple[np.ndarray | _Image.Image | Path | str, str]]
|
131 |
+
| None,
|
132 |
+
) -> GalleryData:
|
133 |
+
"""
|
134 |
+
Parameters:
|
135 |
+
value: list of images, or list of (image, caption) tuples
|
136 |
+
Returns:
|
137 |
+
list of string file paths to images in temp directory
|
138 |
+
"""
|
139 |
+
if value is None:
|
140 |
+
return GalleryData(root=[])
|
141 |
+
output = []
|
142 |
+
for media in value:
|
143 |
+
url = None
|
144 |
+
caption = None
|
145 |
+
mime_type = None
|
146 |
+
if isinstance(media, (tuple, list)):
|
147 |
+
media, caption = media
|
148 |
+
if isinstance(media, np.ndarray):
|
149 |
+
file = processing_utils.save_img_array_to_cache(
|
150 |
+
media, cache_dir=self.GRADIO_CACHE
|
151 |
+
)
|
152 |
+
file_path = str(utils.abspath(file))
|
153 |
+
elif isinstance(media, _Image.Image):
|
154 |
+
file = processing_utils.save_pil_to_cache(
|
155 |
+
media, cache_dir=self.GRADIO_CACHE
|
156 |
+
)
|
157 |
+
file_path = str(utils.abspath(file))
|
158 |
+
elif isinstance(media, str):
|
159 |
+
file_path = media
|
160 |
+
url = media if is_http_url_like(media) else None
|
161 |
+
mime_type = client_utils.get_mimetype(media)
|
162 |
+
elif isinstance(media, Path):
|
163 |
+
file_path = str(media)
|
164 |
+
else:
|
165 |
+
raise ValueError(f"Cannot process type as image: {type(media)}")
|
166 |
+
entry = GalleryImage(
|
167 |
+
image=FileData(path=file_path, url=url, mime_type=mime_type), caption=caption
|
168 |
+
)
|
169 |
+
output.append(entry)
|
170 |
+
return GalleryData(root=output)
|
171 |
+
|
172 |
+
def preprocess(self, payload: GalleryData | None) -> GalleryData | None:
|
173 |
+
if payload is None or not payload.root:
|
174 |
+
return None
|
175 |
+
return payload
|
176 |
+
|
177 |
+
def example_inputs(self) -> Any:
|
178 |
+
return [
|
179 |
+
"https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/video_sample.mp4",
|
180 |
+
"https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/video_sample.mp4",
|
181 |
+
"https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/video_sample.mp4",
|
182 |
+
"https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/video_sample.mp4",
|
183 |
+
]
|
src/backend/gradio_videogallery/videogallery.pyi
ADDED
@@ -0,0 +1,221 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""gr.Gallery() component."""
|
2 |
+
|
3 |
+
from __future__ import annotations
|
4 |
+
|
5 |
+
from pathlib import Path
|
6 |
+
from typing import Any, Callable, List, Literal, Optional
|
7 |
+
|
8 |
+
import numpy as np
|
9 |
+
from gradio_client.documentation import document, set_documentation_group
|
10 |
+
from gradio_client.utils import is_http_url_like
|
11 |
+
from PIL import Image as _Image # using _ to minimize namespace pollution
|
12 |
+
|
13 |
+
from gradio import processing_utils, utils
|
14 |
+
from gradio.components.base import Component
|
15 |
+
from gradio.data_classes import FileData, GradioModel, GradioRootModel
|
16 |
+
from gradio.events import Events
|
17 |
+
|
18 |
+
set_documentation_group("component")
|
19 |
+
|
20 |
+
|
21 |
+
class GalleryImage(GradioModel):
|
22 |
+
image: FileData
|
23 |
+
caption: Optional[str] = None
|
24 |
+
|
25 |
+
|
26 |
+
class GalleryData(GradioRootModel):
|
27 |
+
root: List[GalleryImage]
|
28 |
+
|
29 |
+
from gradio.events import Dependency
|
30 |
+
|
31 |
+
@document()
|
32 |
+
class videogallery(Component):
|
33 |
+
"""
|
34 |
+
Used to display a list of images as a gallery that can be scrolled through.
|
35 |
+
Preprocessing: this component does *not* accept input.
|
36 |
+
Postprocessing: expects a list of images in any format, {List[numpy.array | PIL.Image | str | pathlib.Path]}, or a {List} of (image, {str} caption) tuples and displays them.
|
37 |
+
|
38 |
+
Demos: fake_gan
|
39 |
+
"""
|
40 |
+
|
41 |
+
EVENTS = [Events.select]
|
42 |
+
|
43 |
+
data_model = GalleryData
|
44 |
+
|
45 |
+
def __init__(
|
46 |
+
self,
|
47 |
+
value: list[np.ndarray | _Image.Image | str | Path | tuple]
|
48 |
+
| Callable
|
49 |
+
| None = None,
|
50 |
+
*,
|
51 |
+
label: str | None = None,
|
52 |
+
every: float | None = None,
|
53 |
+
show_label: bool | None = None,
|
54 |
+
container: bool = True,
|
55 |
+
scale: int | None = None,
|
56 |
+
min_width: int = 160,
|
57 |
+
visible: bool = True,
|
58 |
+
elem_id: str | None = None,
|
59 |
+
elem_classes: list[str] | str | None = None,
|
60 |
+
render: bool = True,
|
61 |
+
columns: int | tuple | None = 2,
|
62 |
+
rows: int | tuple | None = None,
|
63 |
+
height: int | float | None = None,
|
64 |
+
allow_preview: bool = True,
|
65 |
+
preview: bool | None = None,
|
66 |
+
selected_index: int | None = None,
|
67 |
+
object_fit: Literal["contain", "cover", "fill", "none", "scale-down"]
|
68 |
+
| None = None,
|
69 |
+
show_share_button: bool | None = None,
|
70 |
+
show_download_button: bool | None = True,
|
71 |
+
):
|
72 |
+
"""
|
73 |
+
Parameters:
|
74 |
+
value: List of images to display in the gallery by default. If callable, the function will be called whenever the app loads to set the initial value of the component.
|
75 |
+
label: The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.
|
76 |
+
every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.
|
77 |
+
show_label: if True, will display label.
|
78 |
+
container: If True, will place the component in a container - providing some extra padding around the border.
|
79 |
+
scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer.
|
80 |
+
min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.
|
81 |
+
visible: If False, component will be hidden.
|
82 |
+
elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
|
83 |
+
elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.
|
84 |
+
render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
|
85 |
+
columns: Represents the number of images that should be shown in one row, for each of the six standard screen sizes (<576px, <768px, <992px, <1200px, <1400px, >1400px). If fewer than 6 are given then the last will be used for all subsequent breakpoints
|
86 |
+
rows: Represents the number of rows in the image grid, for each of the six standard screen sizes (<576px, <768px, <992px, <1200px, <1400px, >1400px). If fewer than 6 are given then the last will be used for all subsequent breakpoints
|
87 |
+
height: The height of the gallery component, in pixels. If more images are displayed than can fit in the height, a scrollbar will appear.
|
88 |
+
allow_preview: If True, images in the gallery will be enlarged when they are clicked. Default is True.
|
89 |
+
preview: If True, videogallery will start in preview mode, which shows all of the images as thumbnails and allows the user to click on them to view them in full size. Only works if allow_preview is True.
|
90 |
+
selected_index: The index of the image that should be initially selected. If None, no image will be selected at start. If provided, will set videogallery to preview mode unless allow_preview is set to False.
|
91 |
+
object_fit: CSS object-fit property for the thumbnail images in the gallery. Can be "contain", "cover", "fill", "none", or "scale-down".
|
92 |
+
show_share_button: If True, will show a share icon in the corner of the component that allows user to share outputs to Hugging Face Spaces Discussions. If False, icon does not appear. If set to None (default behavior), then the icon appears if this Gradio app is launched on Spaces, but not otherwise.
|
93 |
+
show_download_button: If True, will show a download button in the corner of the selected image. If False, the icon does not appear. Default is True.
|
94 |
+
"""
|
95 |
+
self.columns = columns
|
96 |
+
self.rows = rows
|
97 |
+
self.height = height
|
98 |
+
self.preview = preview
|
99 |
+
self.object_fit = object_fit
|
100 |
+
self.allow_preview = allow_preview
|
101 |
+
self.show_download_button = (
|
102 |
+
(utils.get_space() is not None)
|
103 |
+
if show_download_button is None
|
104 |
+
else show_download_button
|
105 |
+
)
|
106 |
+
self.selected_index = selected_index
|
107 |
+
|
108 |
+
self.show_share_button = (
|
109 |
+
(utils.get_space() is not None)
|
110 |
+
if show_share_button is None
|
111 |
+
else show_share_button
|
112 |
+
)
|
113 |
+
super().__init__(
|
114 |
+
label=label,
|
115 |
+
every=every,
|
116 |
+
show_label=show_label,
|
117 |
+
container=container,
|
118 |
+
scale=scale,
|
119 |
+
min_width=min_width,
|
120 |
+
visible=visible,
|
121 |
+
elem_id=elem_id,
|
122 |
+
elem_classes=elem_classes,
|
123 |
+
render=render,
|
124 |
+
value=value,
|
125 |
+
)
|
126 |
+
|
127 |
+
def postprocess(
|
128 |
+
self,
|
129 |
+
value: list[np.ndarray | _Image.Image | str | Path]
|
130 |
+
| list[tuple[np.ndarray | _Image.Image | Path | str, str]]
|
131 |
+
| None,
|
132 |
+
) -> GalleryData:
|
133 |
+
"""
|
134 |
+
Parameters:
|
135 |
+
value: list of images, or list of (image, caption) tuples
|
136 |
+
Returns:
|
137 |
+
list of string file paths to images in temp directory
|
138 |
+
"""
|
139 |
+
if value is None:
|
140 |
+
return GalleryData(root=[])
|
141 |
+
output = []
|
142 |
+
for media in value:
|
143 |
+
url = None
|
144 |
+
caption = None
|
145 |
+
mime_type = None
|
146 |
+
if isinstance(media, (tuple, list)):
|
147 |
+
media, caption = media
|
148 |
+
if isinstance(media, np.ndarray):
|
149 |
+
file = processing_utils.save_img_array_to_cache(
|
150 |
+
media, cache_dir=self.GRADIO_CACHE
|
151 |
+
)
|
152 |
+
file_path = str(utils.abspath(file))
|
153 |
+
elif isinstance(media, _Image.Image):
|
154 |
+
file = processing_utils.save_pil_to_cache(
|
155 |
+
media, cache_dir=self.GRADIO_CACHE
|
156 |
+
)
|
157 |
+
file_path = str(utils.abspath(file))
|
158 |
+
elif isinstance(media, str):
|
159 |
+
file_path = media
|
160 |
+
url = media if is_http_url_like(media) else None
|
161 |
+
mime_type = client_utils.get_mimetype(media)
|
162 |
+
elif isinstance(media, Path):
|
163 |
+
file_path = str(media)
|
164 |
+
else:
|
165 |
+
raise ValueError(f"Cannot process type as image: {type(media)}")
|
166 |
+
entry = GalleryImage(
|
167 |
+
image=FileData(path=file_path, url=url, mime_type=mime_type), caption=caption
|
168 |
+
)
|
169 |
+
output.append(entry)
|
170 |
+
return GalleryData(root=output)
|
171 |
+
|
172 |
+
def preprocess(self, payload: GalleryData | None) -> GalleryData | None:
|
173 |
+
if payload is None or not payload.root:
|
174 |
+
return None
|
175 |
+
return payload
|
176 |
+
|
177 |
+
def example_inputs(self) -> Any:
|
178 |
+
return [
|
179 |
+
"https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/video_sample.mp4",
|
180 |
+
"https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/video_sample.mp4",
|
181 |
+
"https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/video_sample.mp4",
|
182 |
+
"https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/video_sample.mp4",
|
183 |
+
]
|
184 |
+
|
185 |
+
|
186 |
+
def select(self,
|
187 |
+
fn: Callable | None,
|
188 |
+
inputs: Component | Sequence[Component] | set[Component] | None = None,
|
189 |
+
outputs: Component | Sequence[Component] | None = None,
|
190 |
+
api_name: str | None | Literal[False] = None,
|
191 |
+
status_tracker: None = None,
|
192 |
+
scroll_to_output: bool = False,
|
193 |
+
show_progress: Literal["full", "minimal", "hidden"] = "full",
|
194 |
+
queue: bool | None = None,
|
195 |
+
batch: bool = False,
|
196 |
+
max_batch_size: int = 4,
|
197 |
+
preprocess: bool = True,
|
198 |
+
postprocess: bool = True,
|
199 |
+
cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
|
200 |
+
every: float | None = None,
|
201 |
+
trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
|
202 |
+
js: str | None = None,) -> Dependency:
|
203 |
+
"""
|
204 |
+
Parameters:
|
205 |
+
fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.
|
206 |
+
inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
|
207 |
+
outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
|
208 |
+
api_name: Defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.
|
209 |
+
scroll_to_output: If True, will scroll to output component on completion
|
210 |
+
show_progress: If True, will show progress animation while pending
|
211 |
+
queue: If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.
|
212 |
+
batch: If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.
|
213 |
+
max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
|
214 |
+
preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
|
215 |
+
postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
|
216 |
+
cancels: A list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.
|
217 |
+
every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.
|
218 |
+
trigger_mode: If "once" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to "multiple", unlimited submissions are allowed while pending, and "always_last" (default for `.change()` event) would allow a second submission after the pending event is complete.
|
219 |
+
js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
|
220 |
+
"""
|
221 |
+
...
|
src/demo/__init__.py
ADDED
File without changes
|
src/demo/app.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
import gradio as gr
|
3 |
+
from gradio_videogallery import videogallery
|
4 |
+
|
5 |
+
|
6 |
+
example = videogallery().example_inputs()
|
7 |
+
|
8 |
+
with gr.Blocks() as demo:
|
9 |
+
with gr.Row():
|
10 |
+
videogallery(value=example, label="Populated"), # populated component
|
11 |
+
|
12 |
+
demo.launch()
|
src/frontend/Index.svelte
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script context="module" lang="ts">
|
2 |
+
export { default as BaseGallery } from "./shared/Gallery.svelte";
|
3 |
+
</script>
|
4 |
+
|
5 |
+
<script lang="ts">
|
6 |
+
import type { Gradio, ShareData, SelectData } from "@gradio/utils";
|
7 |
+
import { Block } from "@gradio/atoms";
|
8 |
+
import Gallery from "./shared/Gallery.svelte";
|
9 |
+
import type { LoadingStatus } from "@gradio/statustracker";
|
10 |
+
import { StatusTracker } from "@gradio/statustracker";
|
11 |
+
import type { FileData } from "@gradio/client";
|
12 |
+
import { createEventDispatcher } from "svelte";
|
13 |
+
|
14 |
+
export let loading_status: LoadingStatus;
|
15 |
+
export let show_label: boolean;
|
16 |
+
export let label: string;
|
17 |
+
export let root: string;
|
18 |
+
export let proxy_url: null | string;
|
19 |
+
export let elem_id = "";
|
20 |
+
export let elem_classes: string[] = [];
|
21 |
+
export let visible = true;
|
22 |
+
export let value:
|
23 |
+
| { image: FileData; caption: string | null }[]
|
24 |
+
| null
|
25 |
+
| null = null;
|
26 |
+
export let container = true;
|
27 |
+
export let scale: number | null = null;
|
28 |
+
export let min_width: number | undefined = undefined;
|
29 |
+
export let columns: number | number[] | undefined = [2];
|
30 |
+
export let rows: number | number[] | undefined = undefined;
|
31 |
+
export let height: number | "auto" = "auto";
|
32 |
+
export let preview: boolean;
|
33 |
+
export let allow_preview = true;
|
34 |
+
export let selected_index: number | null = null;
|
35 |
+
export let object_fit: "contain" | "cover" | "fill" | "none" | "scale-down" =
|
36 |
+
"cover";
|
37 |
+
export let show_share_button = false;
|
38 |
+
export let show_download_button = false;
|
39 |
+
export let gradio: Gradio<{
|
40 |
+
change: typeof value;
|
41 |
+
select: SelectData;
|
42 |
+
share: ShareData;
|
43 |
+
error: string;
|
44 |
+
prop_change: Record<string, any>;
|
45 |
+
}>;
|
46 |
+
|
47 |
+
const dispatch = createEventDispatcher();
|
48 |
+
|
49 |
+
$: selected_index, dispatch("prop_change", { selected_index });
|
50 |
+
</script>
|
51 |
+
|
52 |
+
<Block
|
53 |
+
{visible}
|
54 |
+
variant="solid"
|
55 |
+
padding={false}
|
56 |
+
{elem_id}
|
57 |
+
{elem_classes}
|
58 |
+
{container}
|
59 |
+
{scale}
|
60 |
+
{min_width}
|
61 |
+
allow_overflow={false}
|
62 |
+
height={typeof height === "number" ? height : undefined}
|
63 |
+
>
|
64 |
+
<StatusTracker
|
65 |
+
autoscroll={gradio.autoscroll}
|
66 |
+
i18n={gradio.i18n}
|
67 |
+
{...loading_status}
|
68 |
+
/>
|
69 |
+
<Gallery
|
70 |
+
on:change={() => gradio.dispatch("change", value)}
|
71 |
+
on:select={(e) => gradio.dispatch("select", e.detail)}
|
72 |
+
on:share={(e) => gradio.dispatch("share", e.detail)}
|
73 |
+
on:error={(e) => gradio.dispatch("error", e.detail)}
|
74 |
+
{label}
|
75 |
+
{value}
|
76 |
+
{show_label}
|
77 |
+
{root}
|
78 |
+
{proxy_url}
|
79 |
+
{columns}
|
80 |
+
{rows}
|
81 |
+
{height}
|
82 |
+
{preview}
|
83 |
+
{object_fit}
|
84 |
+
{allow_preview}
|
85 |
+
bind:selected_index
|
86 |
+
{show_share_button}
|
87 |
+
{show_download_button}
|
88 |
+
i18n={gradio.i18n}
|
89 |
+
/>
|
90 |
+
</Block>
|
src/frontend/package-lock.json
ADDED
@@ -0,0 +1,1047 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "gradio_videogallery",
|
3 |
+
"version": "0.4.4",
|
4 |
+
"lockfileVersion": 3,
|
5 |
+
"requires": true,
|
6 |
+
"packages": {
|
7 |
+
"": {
|
8 |
+
"name": "gradio_videogallery",
|
9 |
+
"version": "0.4.4",
|
10 |
+
"license": "ISC",
|
11 |
+
"dependencies": {
|
12 |
+
"@gradio/atoms": "0.2.1",
|
13 |
+
"@gradio/client": "0.7.2",
|
14 |
+
"@gradio/icons": "0.2.0",
|
15 |
+
"@gradio/image": "0.3.3",
|
16 |
+
"@gradio/statustracker": "0.3.1",
|
17 |
+
"@gradio/upload": "0.3.3",
|
18 |
+
"@gradio/utils": "0.2.0",
|
19 |
+
"dequal": "^2.0.2"
|
20 |
+
}
|
21 |
+
},
|
22 |
+
"node_modules/@ampproject/remapping": {
|
23 |
+
"version": "2.2.1",
|
24 |
+
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz",
|
25 |
+
"integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==",
|
26 |
+
"peer": true,
|
27 |
+
"dependencies": {
|
28 |
+
"@jridgewell/gen-mapping": "^0.3.0",
|
29 |
+
"@jridgewell/trace-mapping": "^0.3.9"
|
30 |
+
},
|
31 |
+
"engines": {
|
32 |
+
"node": ">=6.0.0"
|
33 |
+
}
|
34 |
+
},
|
35 |
+
"node_modules/@esbuild/android-arm": {
|
36 |
+
"version": "0.19.5",
|
37 |
+
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.5.tgz",
|
38 |
+
"integrity": "sha512-bhvbzWFF3CwMs5tbjf3ObfGqbl/17ict2/uwOSfr3wmxDE6VdS2GqY/FuzIPe0q0bdhj65zQsvqfArI9MY6+AA==",
|
39 |
+
"cpu": [
|
40 |
+
"arm"
|
41 |
+
],
|
42 |
+
"optional": true,
|
43 |
+
"os": [
|
44 |
+
"android"
|
45 |
+
],
|
46 |
+
"engines": {
|
47 |
+
"node": ">=12"
|
48 |
+
}
|
49 |
+
},
|
50 |
+
"node_modules/@esbuild/android-arm64": {
|
51 |
+
"version": "0.19.5",
|
52 |
+
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.5.tgz",
|
53 |
+
"integrity": "sha512-5d1OkoJxnYQfmC+Zd8NBFjkhyCNYwM4n9ODrycTFY6Jk1IGiZ+tjVJDDSwDt77nK+tfpGP4T50iMtVi4dEGzhQ==",
|
54 |
+
"cpu": [
|
55 |
+
"arm64"
|
56 |
+
],
|
57 |
+
"optional": true,
|
58 |
+
"os": [
|
59 |
+
"android"
|
60 |
+
],
|
61 |
+
"engines": {
|
62 |
+
"node": ">=12"
|
63 |
+
}
|
64 |
+
},
|
65 |
+
"node_modules/@esbuild/android-x64": {
|
66 |
+
"version": "0.19.5",
|
67 |
+
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.5.tgz",
|
68 |
+
"integrity": "sha512-9t+28jHGL7uBdkBjL90QFxe7DVA+KGqWlHCF8ChTKyaKO//VLuoBricQCgwhOjA1/qOczsw843Fy4cbs4H3DVA==",
|
69 |
+
"cpu": [
|
70 |
+
"x64"
|
71 |
+
],
|
72 |
+
"optional": true,
|
73 |
+
"os": [
|
74 |
+
"android"
|
75 |
+
],
|
76 |
+
"engines": {
|
77 |
+
"node": ">=12"
|
78 |
+
}
|
79 |
+
},
|
80 |
+
"node_modules/@esbuild/darwin-arm64": {
|
81 |
+
"version": "0.19.5",
|
82 |
+
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.5.tgz",
|
83 |
+
"integrity": "sha512-mvXGcKqqIqyKoxq26qEDPHJuBYUA5KizJncKOAf9eJQez+L9O+KfvNFu6nl7SCZ/gFb2QPaRqqmG0doSWlgkqw==",
|
84 |
+
"cpu": [
|
85 |
+
"arm64"
|
86 |
+
],
|
87 |
+
"optional": true,
|
88 |
+
"os": [
|
89 |
+
"darwin"
|
90 |
+
],
|
91 |
+
"engines": {
|
92 |
+
"node": ">=12"
|
93 |
+
}
|
94 |
+
},
|
95 |
+
"node_modules/@esbuild/darwin-x64": {
|
96 |
+
"version": "0.19.5",
|
97 |
+
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.5.tgz",
|
98 |
+
"integrity": "sha512-Ly8cn6fGLNet19s0X4unjcniX24I0RqjPv+kurpXabZYSXGM4Pwpmf85WHJN3lAgB8GSth7s5A0r856S+4DyiA==",
|
99 |
+
"cpu": [
|
100 |
+
"x64"
|
101 |
+
],
|
102 |
+
"optional": true,
|
103 |
+
"os": [
|
104 |
+
"darwin"
|
105 |
+
],
|
106 |
+
"engines": {
|
107 |
+
"node": ">=12"
|
108 |
+
}
|
109 |
+
},
|
110 |
+
"node_modules/@esbuild/freebsd-arm64": {
|
111 |
+
"version": "0.19.5",
|
112 |
+
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.5.tgz",
|
113 |
+
"integrity": "sha512-GGDNnPWTmWE+DMchq1W8Sd0mUkL+APvJg3b11klSGUDvRXh70JqLAO56tubmq1s2cgpVCSKYywEiKBfju8JztQ==",
|
114 |
+
"cpu": [
|
115 |
+
"arm64"
|
116 |
+
],
|
117 |
+
"optional": true,
|
118 |
+
"os": [
|
119 |
+
"freebsd"
|
120 |
+
],
|
121 |
+
"engines": {
|
122 |
+
"node": ">=12"
|
123 |
+
}
|
124 |
+
},
|
125 |
+
"node_modules/@esbuild/freebsd-x64": {
|
126 |
+
"version": "0.19.5",
|
127 |
+
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.5.tgz",
|
128 |
+
"integrity": "sha512-1CCwDHnSSoA0HNwdfoNY0jLfJpd7ygaLAp5EHFos3VWJCRX9DMwWODf96s9TSse39Br7oOTLryRVmBoFwXbuuQ==",
|
129 |
+
"cpu": [
|
130 |
+
"x64"
|
131 |
+
],
|
132 |
+
"optional": true,
|
133 |
+
"os": [
|
134 |
+
"freebsd"
|
135 |
+
],
|
136 |
+
"engines": {
|
137 |
+
"node": ">=12"
|
138 |
+
}
|
139 |
+
},
|
140 |
+
"node_modules/@esbuild/linux-arm": {
|
141 |
+
"version": "0.19.5",
|
142 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.5.tgz",
|
143 |
+
"integrity": "sha512-lrWXLY/vJBzCPC51QN0HM71uWgIEpGSjSZZADQhq7DKhPcI6NH1IdzjfHkDQws2oNpJKpR13kv7/pFHBbDQDwQ==",
|
144 |
+
"cpu": [
|
145 |
+
"arm"
|
146 |
+
],
|
147 |
+
"optional": true,
|
148 |
+
"os": [
|
149 |
+
"linux"
|
150 |
+
],
|
151 |
+
"engines": {
|
152 |
+
"node": ">=12"
|
153 |
+
}
|
154 |
+
},
|
155 |
+
"node_modules/@esbuild/linux-arm64": {
|
156 |
+
"version": "0.19.5",
|
157 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.5.tgz",
|
158 |
+
"integrity": "sha512-o3vYippBmSrjjQUCEEiTZ2l+4yC0pVJD/Dl57WfPwwlvFkrxoSO7rmBZFii6kQB3Wrn/6GwJUPLU5t52eq2meA==",
|
159 |
+
"cpu": [
|
160 |
+
"arm64"
|
161 |
+
],
|
162 |
+
"optional": true,
|
163 |
+
"os": [
|
164 |
+
"linux"
|
165 |
+
],
|
166 |
+
"engines": {
|
167 |
+
"node": ">=12"
|
168 |
+
}
|
169 |
+
},
|
170 |
+
"node_modules/@esbuild/linux-ia32": {
|
171 |
+
"version": "0.19.5",
|
172 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.5.tgz",
|
173 |
+
"integrity": "sha512-MkjHXS03AXAkNp1KKkhSKPOCYztRtK+KXDNkBa6P78F8Bw0ynknCSClO/ztGszILZtyO/lVKpa7MolbBZ6oJtQ==",
|
174 |
+
"cpu": [
|
175 |
+
"ia32"
|
176 |
+
],
|
177 |
+
"optional": true,
|
178 |
+
"os": [
|
179 |
+
"linux"
|
180 |
+
],
|
181 |
+
"engines": {
|
182 |
+
"node": ">=12"
|
183 |
+
}
|
184 |
+
},
|
185 |
+
"node_modules/@esbuild/linux-loong64": {
|
186 |
+
"version": "0.19.5",
|
187 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.5.tgz",
|
188 |
+
"integrity": "sha512-42GwZMm5oYOD/JHqHska3Jg0r+XFb/fdZRX+WjADm3nLWLcIsN27YKtqxzQmGNJgu0AyXg4HtcSK9HuOk3v1Dw==",
|
189 |
+
"cpu": [
|
190 |
+
"loong64"
|
191 |
+
],
|
192 |
+
"optional": true,
|
193 |
+
"os": [
|
194 |
+
"linux"
|
195 |
+
],
|
196 |
+
"engines": {
|
197 |
+
"node": ">=12"
|
198 |
+
}
|
199 |
+
},
|
200 |
+
"node_modules/@esbuild/linux-mips64el": {
|
201 |
+
"version": "0.19.5",
|
202 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.5.tgz",
|
203 |
+
"integrity": "sha512-kcjndCSMitUuPJobWCnwQ9lLjiLZUR3QLQmlgaBfMX23UEa7ZOrtufnRds+6WZtIS9HdTXqND4yH8NLoVVIkcg==",
|
204 |
+
"cpu": [
|
205 |
+
"mips64el"
|
206 |
+
],
|
207 |
+
"optional": true,
|
208 |
+
"os": [
|
209 |
+
"linux"
|
210 |
+
],
|
211 |
+
"engines": {
|
212 |
+
"node": ">=12"
|
213 |
+
}
|
214 |
+
},
|
215 |
+
"node_modules/@esbuild/linux-ppc64": {
|
216 |
+
"version": "0.19.5",
|
217 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.5.tgz",
|
218 |
+
"integrity": "sha512-yJAxJfHVm0ZbsiljbtFFP1BQKLc8kUF6+17tjQ78QjqjAQDnhULWiTA6u0FCDmYT1oOKS9PzZ2z0aBI+Mcyj7Q==",
|
219 |
+
"cpu": [
|
220 |
+
"ppc64"
|
221 |
+
],
|
222 |
+
"optional": true,
|
223 |
+
"os": [
|
224 |
+
"linux"
|
225 |
+
],
|
226 |
+
"engines": {
|
227 |
+
"node": ">=12"
|
228 |
+
}
|
229 |
+
},
|
230 |
+
"node_modules/@esbuild/linux-riscv64": {
|
231 |
+
"version": "0.19.5",
|
232 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.5.tgz",
|
233 |
+
"integrity": "sha512-5u8cIR/t3gaD6ad3wNt1MNRstAZO+aNyBxu2We8X31bA8XUNyamTVQwLDA1SLoPCUehNCymhBhK3Qim1433Zag==",
|
234 |
+
"cpu": [
|
235 |
+
"riscv64"
|
236 |
+
],
|
237 |
+
"optional": true,
|
238 |
+
"os": [
|
239 |
+
"linux"
|
240 |
+
],
|
241 |
+
"engines": {
|
242 |
+
"node": ">=12"
|
243 |
+
}
|
244 |
+
},
|
245 |
+
"node_modules/@esbuild/linux-s390x": {
|
246 |
+
"version": "0.19.5",
|
247 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.5.tgz",
|
248 |
+
"integrity": "sha512-Z6JrMyEw/EmZBD/OFEFpb+gao9xJ59ATsoTNlj39jVBbXqoZm4Xntu6wVmGPB/OATi1uk/DB+yeDPv2E8PqZGw==",
|
249 |
+
"cpu": [
|
250 |
+
"s390x"
|
251 |
+
],
|
252 |
+
"optional": true,
|
253 |
+
"os": [
|
254 |
+
"linux"
|
255 |
+
],
|
256 |
+
"engines": {
|
257 |
+
"node": ">=12"
|
258 |
+
}
|
259 |
+
},
|
260 |
+
"node_modules/@esbuild/linux-x64": {
|
261 |
+
"version": "0.19.5",
|
262 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.5.tgz",
|
263 |
+
"integrity": "sha512-psagl+2RlK1z8zWZOmVdImisMtrUxvwereIdyJTmtmHahJTKb64pAcqoPlx6CewPdvGvUKe2Jw+0Z/0qhSbG1A==",
|
264 |
+
"cpu": [
|
265 |
+
"x64"
|
266 |
+
],
|
267 |
+
"optional": true,
|
268 |
+
"os": [
|
269 |
+
"linux"
|
270 |
+
],
|
271 |
+
"engines": {
|
272 |
+
"node": ">=12"
|
273 |
+
}
|
274 |
+
},
|
275 |
+
"node_modules/@esbuild/netbsd-x64": {
|
276 |
+
"version": "0.19.5",
|
277 |
+
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.5.tgz",
|
278 |
+
"integrity": "sha512-kL2l+xScnAy/E/3119OggX8SrWyBEcqAh8aOY1gr4gPvw76la2GlD4Ymf832UCVbmuWeTf2adkZDK+h0Z/fB4g==",
|
279 |
+
"cpu": [
|
280 |
+
"x64"
|
281 |
+
],
|
282 |
+
"optional": true,
|
283 |
+
"os": [
|
284 |
+
"netbsd"
|
285 |
+
],
|
286 |
+
"engines": {
|
287 |
+
"node": ">=12"
|
288 |
+
}
|
289 |
+
},
|
290 |
+
"node_modules/@esbuild/openbsd-x64": {
|
291 |
+
"version": "0.19.5",
|
292 |
+
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.5.tgz",
|
293 |
+
"integrity": "sha512-sPOfhtzFufQfTBgRnE1DIJjzsXukKSvZxloZbkJDG383q0awVAq600pc1nfqBcl0ice/WN9p4qLc39WhBShRTA==",
|
294 |
+
"cpu": [
|
295 |
+
"x64"
|
296 |
+
],
|
297 |
+
"optional": true,
|
298 |
+
"os": [
|
299 |
+
"openbsd"
|
300 |
+
],
|
301 |
+
"engines": {
|
302 |
+
"node": ">=12"
|
303 |
+
}
|
304 |
+
},
|
305 |
+
"node_modules/@esbuild/sunos-x64": {
|
306 |
+
"version": "0.19.5",
|
307 |
+
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.5.tgz",
|
308 |
+
"integrity": "sha512-dGZkBXaafuKLpDSjKcB0ax0FL36YXCvJNnztjKV+6CO82tTYVDSH2lifitJ29jxRMoUhgkg9a+VA/B03WK5lcg==",
|
309 |
+
"cpu": [
|
310 |
+
"x64"
|
311 |
+
],
|
312 |
+
"optional": true,
|
313 |
+
"os": [
|
314 |
+
"sunos"
|
315 |
+
],
|
316 |
+
"engines": {
|
317 |
+
"node": ">=12"
|
318 |
+
}
|
319 |
+
},
|
320 |
+
"node_modules/@esbuild/win32-arm64": {
|
321 |
+
"version": "0.19.5",
|
322 |
+
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.5.tgz",
|
323 |
+
"integrity": "sha512-dWVjD9y03ilhdRQ6Xig1NWNgfLtf2o/STKTS+eZuF90fI2BhbwD6WlaiCGKptlqXlURVB5AUOxUj09LuwKGDTg==",
|
324 |
+
"cpu": [
|
325 |
+
"arm64"
|
326 |
+
],
|
327 |
+
"optional": true,
|
328 |
+
"os": [
|
329 |
+
"win32"
|
330 |
+
],
|
331 |
+
"engines": {
|
332 |
+
"node": ">=12"
|
333 |
+
}
|
334 |
+
},
|
335 |
+
"node_modules/@esbuild/win32-ia32": {
|
336 |
+
"version": "0.19.5",
|
337 |
+
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.5.tgz",
|
338 |
+
"integrity": "sha512-4liggWIA4oDgUxqpZwrDhmEfAH4d0iljanDOK7AnVU89T6CzHon/ony8C5LeOdfgx60x5cnQJFZwEydVlYx4iw==",
|
339 |
+
"cpu": [
|
340 |
+
"ia32"
|
341 |
+
],
|
342 |
+
"optional": true,
|
343 |
+
"os": [
|
344 |
+
"win32"
|
345 |
+
],
|
346 |
+
"engines": {
|
347 |
+
"node": ">=12"
|
348 |
+
}
|
349 |
+
},
|
350 |
+
"node_modules/@esbuild/win32-x64": {
|
351 |
+
"version": "0.19.5",
|
352 |
+
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.5.tgz",
|
353 |
+
"integrity": "sha512-czTrygUsB/jlM8qEW5MD8bgYU2Xg14lo6kBDXW6HdxKjh8M5PzETGiSHaz9MtbXBYDloHNUAUW2tMiKW4KM9Mw==",
|
354 |
+
"cpu": [
|
355 |
+
"x64"
|
356 |
+
],
|
357 |
+
"optional": true,
|
358 |
+
"os": [
|
359 |
+
"win32"
|
360 |
+
],
|
361 |
+
"engines": {
|
362 |
+
"node": ">=12"
|
363 |
+
}
|
364 |
+
},
|
365 |
+
"node_modules/@formatjs/ecma402-abstract": {
|
366 |
+
"version": "1.11.4",
|
367 |
+
"resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.11.4.tgz",
|
368 |
+
"integrity": "sha512-EBikYFp2JCdIfGEb5G9dyCkTGDmC57KSHhRQOC3aYxoPWVZvfWCDjZwkGYHN7Lis/fmuWl906bnNTJifDQ3sXw==",
|
369 |
+
"dependencies": {
|
370 |
+
"@formatjs/intl-localematcher": "0.2.25",
|
371 |
+
"tslib": "^2.1.0"
|
372 |
+
}
|
373 |
+
},
|
374 |
+
"node_modules/@formatjs/fast-memoize": {
|
375 |
+
"version": "1.2.1",
|
376 |
+
"resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-1.2.1.tgz",
|
377 |
+
"integrity": "sha512-Rg0e76nomkz3vF9IPlKeV+Qynok0r7YZjL6syLz4/urSg0IbjPZCB/iYUMNsYA643gh4mgrX3T7KEIFIxJBQeg==",
|
378 |
+
"dependencies": {
|
379 |
+
"tslib": "^2.1.0"
|
380 |
+
}
|
381 |
+
},
|
382 |
+
"node_modules/@formatjs/icu-messageformat-parser": {
|
383 |
+
"version": "2.1.0",
|
384 |
+
"resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.1.0.tgz",
|
385 |
+
"integrity": "sha512-Qxv/lmCN6hKpBSss2uQ8IROVnta2r9jd3ymUEIjm2UyIkUCHVcbUVRGL/KS/wv7876edvsPe+hjHVJ4z8YuVaw==",
|
386 |
+
"dependencies": {
|
387 |
+
"@formatjs/ecma402-abstract": "1.11.4",
|
388 |
+
"@formatjs/icu-skeleton-parser": "1.3.6",
|
389 |
+
"tslib": "^2.1.0"
|
390 |
+
}
|
391 |
+
},
|
392 |
+
"node_modules/@formatjs/icu-skeleton-parser": {
|
393 |
+
"version": "1.3.6",
|
394 |
+
"resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.3.6.tgz",
|
395 |
+
"integrity": "sha512-I96mOxvml/YLrwU2Txnd4klA7V8fRhb6JG/4hm3VMNmeJo1F03IpV2L3wWt7EweqNLES59SZ4d6hVOPCSf80Bg==",
|
396 |
+
"dependencies": {
|
397 |
+
"@formatjs/ecma402-abstract": "1.11.4",
|
398 |
+
"tslib": "^2.1.0"
|
399 |
+
}
|
400 |
+
},
|
401 |
+
"node_modules/@formatjs/intl-localematcher": {
|
402 |
+
"version": "0.2.25",
|
403 |
+
"resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.2.25.tgz",
|
404 |
+
"integrity": "sha512-YmLcX70BxoSopLFdLr1Ds99NdlTI2oWoLbaUW2M406lxOIPzE1KQhRz2fPUkq34xVZQaihCoU29h0KK7An3bhA==",
|
405 |
+
"dependencies": {
|
406 |
+
"tslib": "^2.1.0"
|
407 |
+
}
|
408 |
+
},
|
409 |
+
"node_modules/@gradio/atoms": {
|
410 |
+
"version": "0.2.1",
|
411 |
+
"resolved": "https://registry.npmjs.org/@gradio/atoms/-/atoms-0.2.1.tgz",
|
412 |
+
"integrity": "sha512-di3kKSbjxKGngvTAaqUaA6whOVs5BFlQULlWDPq1m37VRgUD7Oq2MkIE+T+YiNAhByN93pqA0hGrWwAUUuxy5Q==",
|
413 |
+
"dependencies": {
|
414 |
+
"@gradio/icons": "^0.2.0",
|
415 |
+
"@gradio/utils": "^0.2.0"
|
416 |
+
}
|
417 |
+
},
|
418 |
+
"node_modules/@gradio/client": {
|
419 |
+
"version": "0.7.2",
|
420 |
+
"resolved": "https://registry.npmjs.org/@gradio/client/-/client-0.7.2.tgz",
|
421 |
+
"integrity": "sha512-YkT3c0u38ZYPKvOCmT0xLu3Gau4SwMe1Yo0PNvqTLwHfI4++dp5MJIWH97820MUqgQhYy6V3GmVAliHRmnfPbw==",
|
422 |
+
"dependencies": {
|
423 |
+
"bufferutil": "^4.0.7",
|
424 |
+
"semiver": "^1.1.0",
|
425 |
+
"ws": "^8.13.0"
|
426 |
+
},
|
427 |
+
"engines": {
|
428 |
+
"node": ">=18.0.0"
|
429 |
+
}
|
430 |
+
},
|
431 |
+
"node_modules/@gradio/column": {
|
432 |
+
"version": "0.1.0",
|
433 |
+
"resolved": "https://registry.npmjs.org/@gradio/column/-/column-0.1.0.tgz",
|
434 |
+
"integrity": "sha512-P24nqqVnMXBaDA1f/zSN5HZRho4PxP8Dq+7VltPHlmxIEiZYik2AJ4J0LeuIha34FDO0guu/16evdrpvGIUAfw=="
|
435 |
+
},
|
436 |
+
"node_modules/@gradio/icons": {
|
437 |
+
"version": "0.2.0",
|
438 |
+
"resolved": "https://registry.npmjs.org/@gradio/icons/-/icons-0.2.0.tgz",
|
439 |
+
"integrity": "sha512-rfCSmOF+ALqBOjTWL1ICasyA8JuO0MPwFrtlVMyAWp7R14AN8YChC/gbz5fZ0kNBiGGEYOOfqpKxyvC95jGGlg=="
|
440 |
+
},
|
441 |
+
"node_modules/@gradio/image": {
|
442 |
+
"version": "0.3.3",
|
443 |
+
"resolved": "https://registry.npmjs.org/@gradio/image/-/image-0.3.3.tgz",
|
444 |
+
"integrity": "sha512-SHhvRkybiE4GCBDcZphobgOVDHx0WLcXnVBwPC7YCjKaRLGQ7cL0oBdoro7LK6UTclThzj35ErdbIqRK0Mk1WA==",
|
445 |
+
"dependencies": {
|
446 |
+
"@gradio/atoms": "^0.2.1",
|
447 |
+
"@gradio/client": "^0.7.2",
|
448 |
+
"@gradio/icons": "^0.2.0",
|
449 |
+
"@gradio/statustracker": "^0.3.1",
|
450 |
+
"@gradio/upload": "^0.3.3",
|
451 |
+
"@gradio/utils": "^0.2.0",
|
452 |
+
"@gradio/wasm": "^0.2.0",
|
453 |
+
"cropperjs": "^1.5.12",
|
454 |
+
"lazy-brush": "^1.0.1",
|
455 |
+
"resize-observer-polyfill": "^1.5.1"
|
456 |
+
}
|
457 |
+
},
|
458 |
+
"node_modules/@gradio/statustracker": {
|
459 |
+
"version": "0.3.1",
|
460 |
+
"resolved": "https://registry.npmjs.org/@gradio/statustracker/-/statustracker-0.3.1.tgz",
|
461 |
+
"integrity": "sha512-ZpmXZSnbgoFU2J54SrNntwfo2OEuEoRV310Q0zGVTH1VL7loziR7GuYhfIbgS8qFlrWM0MhMoLGDX+k7LAig5w==",
|
462 |
+
"dependencies": {
|
463 |
+
"@gradio/atoms": "^0.2.1",
|
464 |
+
"@gradio/column": "^0.1.0",
|
465 |
+
"@gradio/icons": "^0.2.0",
|
466 |
+
"@gradio/utils": "^0.2.0"
|
467 |
+
}
|
468 |
+
},
|
469 |
+
"node_modules/@gradio/theme": {
|
470 |
+
"version": "0.2.0",
|
471 |
+
"resolved": "https://registry.npmjs.org/@gradio/theme/-/theme-0.2.0.tgz",
|
472 |
+
"integrity": "sha512-33c68Nk7oRXLn08OxPfjcPm7S4tXGOUV1I1bVgzdM2YV5o1QBOS1GEnXPZPu/CEYPePLMB6bsDwffrLEyLGWVQ=="
|
473 |
+
},
|
474 |
+
"node_modules/@gradio/upload": {
|
475 |
+
"version": "0.3.3",
|
476 |
+
"resolved": "https://registry.npmjs.org/@gradio/upload/-/upload-0.3.3.tgz",
|
477 |
+
"integrity": "sha512-KWRtH9UTe20u1/14KezuZDEwecLZzjDHdSPDUCrk27SrE6ptV8/qLtefOkg9zE+W51iATxDtQAvi0afLQ8XGrw==",
|
478 |
+
"dependencies": {
|
479 |
+
"@gradio/atoms": "^0.2.1",
|
480 |
+
"@gradio/client": "^0.7.2",
|
481 |
+
"@gradio/icons": "^0.2.0",
|
482 |
+
"@gradio/upload": "^0.3.3",
|
483 |
+
"@gradio/utils": "^0.2.0"
|
484 |
+
}
|
485 |
+
},
|
486 |
+
"node_modules/@gradio/utils": {
|
487 |
+
"version": "0.2.0",
|
488 |
+
"resolved": "https://registry.npmjs.org/@gradio/utils/-/utils-0.2.0.tgz",
|
489 |
+
"integrity": "sha512-YkwzXufi6IxQrlMW+1sFo8Yn6F9NLL69ZoBsbo7QEhms0v5L7pmOTw+dfd7M3dwbRP2lgjrb52i1kAIN3n6aqQ==",
|
490 |
+
"dependencies": {
|
491 |
+
"@gradio/theme": "^0.2.0",
|
492 |
+
"svelte-i18n": "^3.6.0"
|
493 |
+
}
|
494 |
+
},
|
495 |
+
"node_modules/@gradio/wasm": {
|
496 |
+
"version": "0.2.0",
|
497 |
+
"resolved": "https://registry.npmjs.org/@gradio/wasm/-/wasm-0.2.0.tgz",
|
498 |
+
"integrity": "sha512-lU0Uzn4avbyO4AA1yp7IR2FQcO23YUEU3kn0NA8S9cGIZLzxj1FepPO1TsNXtMymDdKKx72TJW2v4yrv/j3H2A==",
|
499 |
+
"dependencies": {
|
500 |
+
"@types/path-browserify": "^1.0.0",
|
501 |
+
"path-browserify": "^1.0.1"
|
502 |
+
}
|
503 |
+
},
|
504 |
+
"node_modules/@jridgewell/gen-mapping": {
|
505 |
+
"version": "0.3.3",
|
506 |
+
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz",
|
507 |
+
"integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==",
|
508 |
+
"peer": true,
|
509 |
+
"dependencies": {
|
510 |
+
"@jridgewell/set-array": "^1.0.1",
|
511 |
+
"@jridgewell/sourcemap-codec": "^1.4.10",
|
512 |
+
"@jridgewell/trace-mapping": "^0.3.9"
|
513 |
+
},
|
514 |
+
"engines": {
|
515 |
+
"node": ">=6.0.0"
|
516 |
+
}
|
517 |
+
},
|
518 |
+
"node_modules/@jridgewell/resolve-uri": {
|
519 |
+
"version": "3.1.1",
|
520 |
+
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
|
521 |
+
"integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==",
|
522 |
+
"peer": true,
|
523 |
+
"engines": {
|
524 |
+
"node": ">=6.0.0"
|
525 |
+
}
|
526 |
+
},
|
527 |
+
"node_modules/@jridgewell/set-array": {
|
528 |
+
"version": "1.1.2",
|
529 |
+
"resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz",
|
530 |
+
"integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==",
|
531 |
+
"peer": true,
|
532 |
+
"engines": {
|
533 |
+
"node": ">=6.0.0"
|
534 |
+
}
|
535 |
+
},
|
536 |
+
"node_modules/@jridgewell/sourcemap-codec": {
|
537 |
+
"version": "1.4.15",
|
538 |
+
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
|
539 |
+
"integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
|
540 |
+
"peer": true
|
541 |
+
},
|
542 |
+
"node_modules/@jridgewell/trace-mapping": {
|
543 |
+
"version": "0.3.20",
|
544 |
+
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz",
|
545 |
+
"integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==",
|
546 |
+
"peer": true,
|
547 |
+
"dependencies": {
|
548 |
+
"@jridgewell/resolve-uri": "^3.1.0",
|
549 |
+
"@jridgewell/sourcemap-codec": "^1.4.14"
|
550 |
+
}
|
551 |
+
},
|
552 |
+
"node_modules/@types/estree": {
|
553 |
+
"version": "1.0.5",
|
554 |
+
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
|
555 |
+
"integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==",
|
556 |
+
"peer": true
|
557 |
+
},
|
558 |
+
"node_modules/@types/path-browserify": {
|
559 |
+
"version": "1.0.2",
|
560 |
+
"resolved": "https://registry.npmjs.org/@types/path-browserify/-/path-browserify-1.0.2.tgz",
|
561 |
+
"integrity": "sha512-ZkC5IUqqIFPXx3ASTTybTzmQdwHwe2C0u3eL75ldQ6T9E9IWFJodn6hIfbZGab73DfyiHN4Xw15gNxUq2FbvBA=="
|
562 |
+
},
|
563 |
+
"node_modules/acorn": {
|
564 |
+
"version": "8.11.2",
|
565 |
+
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz",
|
566 |
+
"integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==",
|
567 |
+
"peer": true,
|
568 |
+
"bin": {
|
569 |
+
"acorn": "bin/acorn"
|
570 |
+
},
|
571 |
+
"engines": {
|
572 |
+
"node": ">=0.4.0"
|
573 |
+
}
|
574 |
+
},
|
575 |
+
"node_modules/aria-query": {
|
576 |
+
"version": "5.3.0",
|
577 |
+
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",
|
578 |
+
"integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
|
579 |
+
"peer": true,
|
580 |
+
"dependencies": {
|
581 |
+
"dequal": "^2.0.3"
|
582 |
+
}
|
583 |
+
},
|
584 |
+
"node_modules/axobject-query": {
|
585 |
+
"version": "3.2.1",
|
586 |
+
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz",
|
587 |
+
"integrity": "sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==",
|
588 |
+
"peer": true,
|
589 |
+
"dependencies": {
|
590 |
+
"dequal": "^2.0.3"
|
591 |
+
}
|
592 |
+
},
|
593 |
+
"node_modules/bufferutil": {
|
594 |
+
"version": "4.0.8",
|
595 |
+
"resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.8.tgz",
|
596 |
+
"integrity": "sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==",
|
597 |
+
"hasInstallScript": true,
|
598 |
+
"dependencies": {
|
599 |
+
"node-gyp-build": "^4.3.0"
|
600 |
+
},
|
601 |
+
"engines": {
|
602 |
+
"node": ">=6.14.2"
|
603 |
+
}
|
604 |
+
},
|
605 |
+
"node_modules/cli-color": {
|
606 |
+
"version": "2.0.3",
|
607 |
+
"resolved": "https://registry.npmjs.org/cli-color/-/cli-color-2.0.3.tgz",
|
608 |
+
"integrity": "sha512-OkoZnxyC4ERN3zLzZaY9Emb7f/MhBOIpePv0Ycok0fJYT+Ouo00UBEIwsVsr0yoow++n5YWlSUgST9GKhNHiRQ==",
|
609 |
+
"dependencies": {
|
610 |
+
"d": "^1.0.1",
|
611 |
+
"es5-ext": "^0.10.61",
|
612 |
+
"es6-iterator": "^2.0.3",
|
613 |
+
"memoizee": "^0.4.15",
|
614 |
+
"timers-ext": "^0.1.7"
|
615 |
+
},
|
616 |
+
"engines": {
|
617 |
+
"node": ">=0.10"
|
618 |
+
}
|
619 |
+
},
|
620 |
+
"node_modules/code-red": {
|
621 |
+
"version": "1.0.4",
|
622 |
+
"resolved": "https://registry.npmjs.org/code-red/-/code-red-1.0.4.tgz",
|
623 |
+
"integrity": "sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==",
|
624 |
+
"peer": true,
|
625 |
+
"dependencies": {
|
626 |
+
"@jridgewell/sourcemap-codec": "^1.4.15",
|
627 |
+
"@types/estree": "^1.0.1",
|
628 |
+
"acorn": "^8.10.0",
|
629 |
+
"estree-walker": "^3.0.3",
|
630 |
+
"periscopic": "^3.1.0"
|
631 |
+
}
|
632 |
+
},
|
633 |
+
"node_modules/cropperjs": {
|
634 |
+
"version": "1.6.1",
|
635 |
+
"resolved": "https://registry.npmjs.org/cropperjs/-/cropperjs-1.6.1.tgz",
|
636 |
+
"integrity": "sha512-F4wsi+XkDHCOMrHMYjrTEE4QBOrsHHN5/2VsVAaRq8P7E5z7xQpT75S+f/9WikmBEailas3+yo+6zPIomW+NOA=="
|
637 |
+
},
|
638 |
+
"node_modules/css-tree": {
|
639 |
+
"version": "2.3.1",
|
640 |
+
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz",
|
641 |
+
"integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==",
|
642 |
+
"peer": true,
|
643 |
+
"dependencies": {
|
644 |
+
"mdn-data": "2.0.30",
|
645 |
+
"source-map-js": "^1.0.1"
|
646 |
+
},
|
647 |
+
"engines": {
|
648 |
+
"node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0"
|
649 |
+
}
|
650 |
+
},
|
651 |
+
"node_modules/d": {
|
652 |
+
"version": "1.0.1",
|
653 |
+
"resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz",
|
654 |
+
"integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==",
|
655 |
+
"dependencies": {
|
656 |
+
"es5-ext": "^0.10.50",
|
657 |
+
"type": "^1.0.1"
|
658 |
+
}
|
659 |
+
},
|
660 |
+
"node_modules/deepmerge": {
|
661 |
+
"version": "4.3.1",
|
662 |
+
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
|
663 |
+
"integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",
|
664 |
+
"engines": {
|
665 |
+
"node": ">=0.10.0"
|
666 |
+
}
|
667 |
+
},
|
668 |
+
"node_modules/dequal": {
|
669 |
+
"version": "2.0.3",
|
670 |
+
"resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
|
671 |
+
"integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
|
672 |
+
"engines": {
|
673 |
+
"node": ">=6"
|
674 |
+
}
|
675 |
+
},
|
676 |
+
"node_modules/es5-ext": {
|
677 |
+
"version": "0.10.62",
|
678 |
+
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz",
|
679 |
+
"integrity": "sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==",
|
680 |
+
"hasInstallScript": true,
|
681 |
+
"dependencies": {
|
682 |
+
"es6-iterator": "^2.0.3",
|
683 |
+
"es6-symbol": "^3.1.3",
|
684 |
+
"next-tick": "^1.1.0"
|
685 |
+
},
|
686 |
+
"engines": {
|
687 |
+
"node": ">=0.10"
|
688 |
+
}
|
689 |
+
},
|
690 |
+
"node_modules/es6-iterator": {
|
691 |
+
"version": "2.0.3",
|
692 |
+
"resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
|
693 |
+
"integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==",
|
694 |
+
"dependencies": {
|
695 |
+
"d": "1",
|
696 |
+
"es5-ext": "^0.10.35",
|
697 |
+
"es6-symbol": "^3.1.1"
|
698 |
+
}
|
699 |
+
},
|
700 |
+
"node_modules/es6-symbol": {
|
701 |
+
"version": "3.1.3",
|
702 |
+
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz",
|
703 |
+
"integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==",
|
704 |
+
"dependencies": {
|
705 |
+
"d": "^1.0.1",
|
706 |
+
"ext": "^1.1.2"
|
707 |
+
}
|
708 |
+
},
|
709 |
+
"node_modules/es6-weak-map": {
|
710 |
+
"version": "2.0.3",
|
711 |
+
"resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz",
|
712 |
+
"integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==",
|
713 |
+
"dependencies": {
|
714 |
+
"d": "1",
|
715 |
+
"es5-ext": "^0.10.46",
|
716 |
+
"es6-iterator": "^2.0.3",
|
717 |
+
"es6-symbol": "^3.1.1"
|
718 |
+
}
|
719 |
+
},
|
720 |
+
"node_modules/esbuild": {
|
721 |
+
"version": "0.19.5",
|
722 |
+
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.5.tgz",
|
723 |
+
"integrity": "sha512-bUxalY7b1g8vNhQKdB24QDmHeY4V4tw/s6Ak5z+jJX9laP5MoQseTOMemAr0gxssjNcH0MCViG8ONI2kksvfFQ==",
|
724 |
+
"hasInstallScript": true,
|
725 |
+
"bin": {
|
726 |
+
"esbuild": "bin/esbuild"
|
727 |
+
},
|
728 |
+
"engines": {
|
729 |
+
"node": ">=12"
|
730 |
+
},
|
731 |
+
"optionalDependencies": {
|
732 |
+
"@esbuild/android-arm": "0.19.5",
|
733 |
+
"@esbuild/android-arm64": "0.19.5",
|
734 |
+
"@esbuild/android-x64": "0.19.5",
|
735 |
+
"@esbuild/darwin-arm64": "0.19.5",
|
736 |
+
"@esbuild/darwin-x64": "0.19.5",
|
737 |
+
"@esbuild/freebsd-arm64": "0.19.5",
|
738 |
+
"@esbuild/freebsd-x64": "0.19.5",
|
739 |
+
"@esbuild/linux-arm": "0.19.5",
|
740 |
+
"@esbuild/linux-arm64": "0.19.5",
|
741 |
+
"@esbuild/linux-ia32": "0.19.5",
|
742 |
+
"@esbuild/linux-loong64": "0.19.5",
|
743 |
+
"@esbuild/linux-mips64el": "0.19.5",
|
744 |
+
"@esbuild/linux-ppc64": "0.19.5",
|
745 |
+
"@esbuild/linux-riscv64": "0.19.5",
|
746 |
+
"@esbuild/linux-s390x": "0.19.5",
|
747 |
+
"@esbuild/linux-x64": "0.19.5",
|
748 |
+
"@esbuild/netbsd-x64": "0.19.5",
|
749 |
+
"@esbuild/openbsd-x64": "0.19.5",
|
750 |
+
"@esbuild/sunos-x64": "0.19.5",
|
751 |
+
"@esbuild/win32-arm64": "0.19.5",
|
752 |
+
"@esbuild/win32-ia32": "0.19.5",
|
753 |
+
"@esbuild/win32-x64": "0.19.5"
|
754 |
+
}
|
755 |
+
},
|
756 |
+
"node_modules/estree-walker": {
|
757 |
+
"version": "3.0.3",
|
758 |
+
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
|
759 |
+
"integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
|
760 |
+
"peer": true,
|
761 |
+
"dependencies": {
|
762 |
+
"@types/estree": "^1.0.0"
|
763 |
+
}
|
764 |
+
},
|
765 |
+
"node_modules/event-emitter": {
|
766 |
+
"version": "0.3.5",
|
767 |
+
"resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz",
|
768 |
+
"integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==",
|
769 |
+
"dependencies": {
|
770 |
+
"d": "1",
|
771 |
+
"es5-ext": "~0.10.14"
|
772 |
+
}
|
773 |
+
},
|
774 |
+
"node_modules/ext": {
|
775 |
+
"version": "1.7.0",
|
776 |
+
"resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz",
|
777 |
+
"integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==",
|
778 |
+
"dependencies": {
|
779 |
+
"type": "^2.7.2"
|
780 |
+
}
|
781 |
+
},
|
782 |
+
"node_modules/ext/node_modules/type": {
|
783 |
+
"version": "2.7.2",
|
784 |
+
"resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz",
|
785 |
+
"integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw=="
|
786 |
+
},
|
787 |
+
"node_modules/globalyzer": {
|
788 |
+
"version": "0.1.0",
|
789 |
+
"resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz",
|
790 |
+
"integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q=="
|
791 |
+
},
|
792 |
+
"node_modules/globrex": {
|
793 |
+
"version": "0.1.2",
|
794 |
+
"resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
|
795 |
+
"integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg=="
|
796 |
+
},
|
797 |
+
"node_modules/intl-messageformat": {
|
798 |
+
"version": "9.13.0",
|
799 |
+
"resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-9.13.0.tgz",
|
800 |
+
"integrity": "sha512-7sGC7QnSQGa5LZP7bXLDhVDtQOeKGeBFGHF2Y8LVBwYZoQZCgWeKoPGTa5GMG8g/TzDgeXuYJQis7Ggiw2xTOw==",
|
801 |
+
"dependencies": {
|
802 |
+
"@formatjs/ecma402-abstract": "1.11.4",
|
803 |
+
"@formatjs/fast-memoize": "1.2.1",
|
804 |
+
"@formatjs/icu-messageformat-parser": "2.1.0",
|
805 |
+
"tslib": "^2.1.0"
|
806 |
+
}
|
807 |
+
},
|
808 |
+
"node_modules/is-promise": {
|
809 |
+
"version": "2.2.2",
|
810 |
+
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz",
|
811 |
+
"integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ=="
|
812 |
+
},
|
813 |
+
"node_modules/is-reference": {
|
814 |
+
"version": "3.0.2",
|
815 |
+
"resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz",
|
816 |
+
"integrity": "sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==",
|
817 |
+
"peer": true,
|
818 |
+
"dependencies": {
|
819 |
+
"@types/estree": "*"
|
820 |
+
}
|
821 |
+
},
|
822 |
+
"node_modules/lazy-brush": {
|
823 |
+
"version": "1.0.1",
|
824 |
+
"resolved": "https://registry.npmjs.org/lazy-brush/-/lazy-brush-1.0.1.tgz",
|
825 |
+
"integrity": "sha512-xT/iSClTVi7vLoF8dCWTBhCuOWqsLXCMPa6ucVmVAk6hyNCM5JeS1NLhXqIrJktUg+caEYKlqSOUU4u3cpXzKg=="
|
826 |
+
},
|
827 |
+
"node_modules/locate-character": {
|
828 |
+
"version": "3.0.0",
|
829 |
+
"resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz",
|
830 |
+
"integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==",
|
831 |
+
"peer": true
|
832 |
+
},
|
833 |
+
"node_modules/lru-queue": {
|
834 |
+
"version": "0.1.0",
|
835 |
+
"resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz",
|
836 |
+
"integrity": "sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==",
|
837 |
+
"dependencies": {
|
838 |
+
"es5-ext": "~0.10.2"
|
839 |
+
}
|
840 |
+
},
|
841 |
+
"node_modules/magic-string": {
|
842 |
+
"version": "0.30.5",
|
843 |
+
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz",
|
844 |
+
"integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==",
|
845 |
+
"peer": true,
|
846 |
+
"dependencies": {
|
847 |
+
"@jridgewell/sourcemap-codec": "^1.4.15"
|
848 |
+
},
|
849 |
+
"engines": {
|
850 |
+
"node": ">=12"
|
851 |
+
}
|
852 |
+
},
|
853 |
+
"node_modules/mdn-data": {
|
854 |
+
"version": "2.0.30",
|
855 |
+
"resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz",
|
856 |
+
"integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==",
|
857 |
+
"peer": true
|
858 |
+
},
|
859 |
+
"node_modules/memoizee": {
|
860 |
+
"version": "0.4.15",
|
861 |
+
"resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz",
|
862 |
+
"integrity": "sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==",
|
863 |
+
"dependencies": {
|
864 |
+
"d": "^1.0.1",
|
865 |
+
"es5-ext": "^0.10.53",
|
866 |
+
"es6-weak-map": "^2.0.3",
|
867 |
+
"event-emitter": "^0.3.5",
|
868 |
+
"is-promise": "^2.2.2",
|
869 |
+
"lru-queue": "^0.1.0",
|
870 |
+
"next-tick": "^1.1.0",
|
871 |
+
"timers-ext": "^0.1.7"
|
872 |
+
}
|
873 |
+
},
|
874 |
+
"node_modules/mri": {
|
875 |
+
"version": "1.2.0",
|
876 |
+
"resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
|
877 |
+
"integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==",
|
878 |
+
"engines": {
|
879 |
+
"node": ">=4"
|
880 |
+
}
|
881 |
+
},
|
882 |
+
"node_modules/next-tick": {
|
883 |
+
"version": "1.1.0",
|
884 |
+
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz",
|
885 |
+
"integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ=="
|
886 |
+
},
|
887 |
+
"node_modules/node-gyp-build": {
|
888 |
+
"version": "4.6.1",
|
889 |
+
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.1.tgz",
|
890 |
+
"integrity": "sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ==",
|
891 |
+
"bin": {
|
892 |
+
"node-gyp-build": "bin.js",
|
893 |
+
"node-gyp-build-optional": "optional.js",
|
894 |
+
"node-gyp-build-test": "build-test.js"
|
895 |
+
}
|
896 |
+
},
|
897 |
+
"node_modules/path-browserify": {
|
898 |
+
"version": "1.0.1",
|
899 |
+
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
|
900 |
+
"integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g=="
|
901 |
+
},
|
902 |
+
"node_modules/periscopic": {
|
903 |
+
"version": "3.1.0",
|
904 |
+
"resolved": "https://registry.npmjs.org/periscopic/-/periscopic-3.1.0.tgz",
|
905 |
+
"integrity": "sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==",
|
906 |
+
"peer": true,
|
907 |
+
"dependencies": {
|
908 |
+
"@types/estree": "^1.0.0",
|
909 |
+
"estree-walker": "^3.0.0",
|
910 |
+
"is-reference": "^3.0.0"
|
911 |
+
}
|
912 |
+
},
|
913 |
+
"node_modules/resize-observer-polyfill": {
|
914 |
+
"version": "1.5.1",
|
915 |
+
"resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz",
|
916 |
+
"integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg=="
|
917 |
+
},
|
918 |
+
"node_modules/sade": {
|
919 |
+
"version": "1.8.1",
|
920 |
+
"resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz",
|
921 |
+
"integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==",
|
922 |
+
"dependencies": {
|
923 |
+
"mri": "^1.1.0"
|
924 |
+
},
|
925 |
+
"engines": {
|
926 |
+
"node": ">=6"
|
927 |
+
}
|
928 |
+
},
|
929 |
+
"node_modules/semiver": {
|
930 |
+
"version": "1.1.0",
|
931 |
+
"resolved": "https://registry.npmjs.org/semiver/-/semiver-1.1.0.tgz",
|
932 |
+
"integrity": "sha512-QNI2ChmuioGC1/xjyYwyZYADILWyW6AmS1UH6gDj/SFUUUS4MBAWs/7mxnkRPc/F4iHezDP+O8t0dO8WHiEOdg==",
|
933 |
+
"engines": {
|
934 |
+
"node": ">=6"
|
935 |
+
}
|
936 |
+
},
|
937 |
+
"node_modules/source-map-js": {
|
938 |
+
"version": "1.0.2",
|
939 |
+
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
|
940 |
+
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
|
941 |
+
"peer": true,
|
942 |
+
"engines": {
|
943 |
+
"node": ">=0.10.0"
|
944 |
+
}
|
945 |
+
},
|
946 |
+
"node_modules/svelte": {
|
947 |
+
"version": "4.2.2",
|
948 |
+
"resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.2.tgz",
|
949 |
+
"integrity": "sha512-My2tytF2e2NnHSpn2M7/3VdXT4JdTglYVUuSuK/mXL2XtulPYbeBfl8Dm1QiaKRn0zoULRnL+EtfZHHP0k4H3A==",
|
950 |
+
"peer": true,
|
951 |
+
"dependencies": {
|
952 |
+
"@ampproject/remapping": "^2.2.1",
|
953 |
+
"@jridgewell/sourcemap-codec": "^1.4.15",
|
954 |
+
"@jridgewell/trace-mapping": "^0.3.18",
|
955 |
+
"acorn": "^8.9.0",
|
956 |
+
"aria-query": "^5.3.0",
|
957 |
+
"axobject-query": "^3.2.1",
|
958 |
+
"code-red": "^1.0.3",
|
959 |
+
"css-tree": "^2.3.1",
|
960 |
+
"estree-walker": "^3.0.3",
|
961 |
+
"is-reference": "^3.0.1",
|
962 |
+
"locate-character": "^3.0.0",
|
963 |
+
"magic-string": "^0.30.4",
|
964 |
+
"periscopic": "^3.1.0"
|
965 |
+
},
|
966 |
+
"engines": {
|
967 |
+
"node": ">=16"
|
968 |
+
}
|
969 |
+
},
|
970 |
+
"node_modules/svelte-i18n": {
|
971 |
+
"version": "3.7.4",
|
972 |
+
"resolved": "https://registry.npmjs.org/svelte-i18n/-/svelte-i18n-3.7.4.tgz",
|
973 |
+
"integrity": "sha512-yGRCNo+eBT4cPuU7IVsYTYjxB7I2V8qgUZPlHnNctJj5IgbJgV78flsRzpjZ/8iUYZrS49oCt7uxlU3AZv/N5Q==",
|
974 |
+
"dependencies": {
|
975 |
+
"cli-color": "^2.0.3",
|
976 |
+
"deepmerge": "^4.2.2",
|
977 |
+
"esbuild": "^0.19.2",
|
978 |
+
"estree-walker": "^2",
|
979 |
+
"intl-messageformat": "^9.13.0",
|
980 |
+
"sade": "^1.8.1",
|
981 |
+
"tiny-glob": "^0.2.9"
|
982 |
+
},
|
983 |
+
"bin": {
|
984 |
+
"svelte-i18n": "dist/cli.js"
|
985 |
+
},
|
986 |
+
"engines": {
|
987 |
+
"node": ">= 16"
|
988 |
+
},
|
989 |
+
"peerDependencies": {
|
990 |
+
"svelte": "^3 || ^4"
|
991 |
+
}
|
992 |
+
},
|
993 |
+
"node_modules/svelte-i18n/node_modules/estree-walker": {
|
994 |
+
"version": "2.0.2",
|
995 |
+
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
|
996 |
+
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
|
997 |
+
},
|
998 |
+
"node_modules/timers-ext": {
|
999 |
+
"version": "0.1.7",
|
1000 |
+
"resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz",
|
1001 |
+
"integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==",
|
1002 |
+
"dependencies": {
|
1003 |
+
"es5-ext": "~0.10.46",
|
1004 |
+
"next-tick": "1"
|
1005 |
+
}
|
1006 |
+
},
|
1007 |
+
"node_modules/tiny-glob": {
|
1008 |
+
"version": "0.2.9",
|
1009 |
+
"resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz",
|
1010 |
+
"integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==",
|
1011 |
+
"dependencies": {
|
1012 |
+
"globalyzer": "0.1.0",
|
1013 |
+
"globrex": "^0.1.2"
|
1014 |
+
}
|
1015 |
+
},
|
1016 |
+
"node_modules/tslib": {
|
1017 |
+
"version": "2.6.2",
|
1018 |
+
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
|
1019 |
+
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
|
1020 |
+
},
|
1021 |
+
"node_modules/type": {
|
1022 |
+
"version": "1.2.0",
|
1023 |
+
"resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz",
|
1024 |
+
"integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg=="
|
1025 |
+
},
|
1026 |
+
"node_modules/ws": {
|
1027 |
+
"version": "8.14.2",
|
1028 |
+
"resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz",
|
1029 |
+
"integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==",
|
1030 |
+
"engines": {
|
1031 |
+
"node": ">=10.0.0"
|
1032 |
+
},
|
1033 |
+
"peerDependencies": {
|
1034 |
+
"bufferutil": "^4.0.1",
|
1035 |
+
"utf-8-validate": ">=5.0.2"
|
1036 |
+
},
|
1037 |
+
"peerDependenciesMeta": {
|
1038 |
+
"bufferutil": {
|
1039 |
+
"optional": true
|
1040 |
+
},
|
1041 |
+
"utf-8-validate": {
|
1042 |
+
"optional": true
|
1043 |
+
}
|
1044 |
+
}
|
1045 |
+
}
|
1046 |
+
}
|
1047 |
+
}
|
src/frontend/package.json
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "gradio_videogallery",
|
3 |
+
"version": "0.4.4",
|
4 |
+
"description": "Gradio UI packages",
|
5 |
+
"type": "module",
|
6 |
+
"author": "",
|
7 |
+
"license": "ISC",
|
8 |
+
"private": false,
|
9 |
+
"dependencies": {
|
10 |
+
"@gradio/atoms": "0.2.1",
|
11 |
+
"@gradio/client": "0.7.2",
|
12 |
+
"@gradio/icons": "0.2.0",
|
13 |
+
"@gradio/image": "0.3.3",
|
14 |
+
"@gradio/statustracker": "0.3.1",
|
15 |
+
"@gradio/upload": "0.3.3",
|
16 |
+
"@gradio/utils": "0.2.0",
|
17 |
+
"dequal": "^2.0.2"
|
18 |
+
},
|
19 |
+
"main": "./Index.svelte",
|
20 |
+
"main_changeset": true,
|
21 |
+
"exports": {
|
22 |
+
".": "./Index.svelte",
|
23 |
+
"./package.json": "./package.json"
|
24 |
+
}
|
25 |
+
}
|
src/frontend/shared/Gallery.svelte
ADDED
@@ -0,0 +1,509 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script lang="ts">
|
2 |
+
import { BlockLabel, Empty, ShareButton } from "@gradio/atoms";
|
3 |
+
import { ModifyUpload } from "@gradio/upload";
|
4 |
+
import type { SelectData } from "@gradio/utils";
|
5 |
+
import { dequal } from "dequal";
|
6 |
+
import { createEventDispatcher } from "svelte";
|
7 |
+
import { tick } from "svelte";
|
8 |
+
|
9 |
+
import { Download, Image } from "@gradio/icons";
|
10 |
+
import { normalise_file, type FileData } from "@gradio/client";
|
11 |
+
import { format_gallery_for_sharing } from "./utils";
|
12 |
+
import { IconButton } from "@gradio/atoms";
|
13 |
+
import type { I18nFormatter } from "@gradio/utils";
|
14 |
+
|
15 |
+
export let show_label = true;
|
16 |
+
export let label: string;
|
17 |
+
export let root = "";
|
18 |
+
export let proxy_url: null | string = null;
|
19 |
+
export let value: { image: FileData; caption: string | null }[] | null = null;
|
20 |
+
export let columns: number | number[] | undefined = [2];
|
21 |
+
export let rows: number | number[] | undefined = undefined;
|
22 |
+
export let height: number | "auto" = "auto";
|
23 |
+
export let preview: boolean;
|
24 |
+
export let allow_preview = true;
|
25 |
+
export let object_fit: "contain" | "cover" | "fill" | "none" | "scale-down" =
|
26 |
+
"cover";
|
27 |
+
export let show_share_button = false;
|
28 |
+
export let show_download_button = false;
|
29 |
+
export let i18n: I18nFormatter;
|
30 |
+
export let selected_index: number | null = null;
|
31 |
+
|
32 |
+
const dispatch = createEventDispatcher<{
|
33 |
+
change: undefined;
|
34 |
+
select: SelectData;
|
35 |
+
}>();
|
36 |
+
|
37 |
+
// tracks whether the value of the gallery was reset
|
38 |
+
let was_reset = true;
|
39 |
+
|
40 |
+
$: was_reset = value == null || value.length == 0 ? true : was_reset;
|
41 |
+
|
42 |
+
let _value: { image: FileData; caption: string | null }[] | null = null;
|
43 |
+
$: _value =
|
44 |
+
value === null
|
45 |
+
? null
|
46 |
+
: value.map((data) => ({
|
47 |
+
image: normalise_file(data.image, root, proxy_url) as FileData,
|
48 |
+
caption: data.caption
|
49 |
+
}));
|
50 |
+
|
51 |
+
let prevValue: { image: FileData; caption: string | null }[] | null | null =
|
52 |
+
value;
|
53 |
+
if (selected_index === null && preview && value?.length) {
|
54 |
+
selected_index = 0;
|
55 |
+
}
|
56 |
+
let old_selected_index: number | null = selected_index;
|
57 |
+
|
58 |
+
$: if (!dequal(prevValue, value)) {
|
59 |
+
// When value is falsy (clear button or first load),
|
60 |
+
// preview determines the selected image
|
61 |
+
if (was_reset) {
|
62 |
+
selected_index = preview && value?.length ? 0 : null;
|
63 |
+
was_reset = false;
|
64 |
+
// Otherwise we keep the selected_index the same if the
|
65 |
+
// gallery has at least as many elements as it did before
|
66 |
+
} else {
|
67 |
+
selected_index =
|
68 |
+
selected_index !== null &&
|
69 |
+
value !== null &&
|
70 |
+
selected_index < value.length
|
71 |
+
? selected_index
|
72 |
+
: null;
|
73 |
+
}
|
74 |
+
dispatch("change");
|
75 |
+
prevValue = value;
|
76 |
+
}
|
77 |
+
|
78 |
+
$: previous =
|
79 |
+
((selected_index ?? 0) + (_value?.length ?? 0) - 1) % (_value?.length ?? 0);
|
80 |
+
$: next = ((selected_index ?? 0) + 1) % (_value?.length ?? 0);
|
81 |
+
|
82 |
+
function handle_preview_click(event: MouseEvent): void {
|
83 |
+
const element = event.target as HTMLElement;
|
84 |
+
const x = event.clientX;
|
85 |
+
const width = element.offsetWidth;
|
86 |
+
const centerX = width / 2;
|
87 |
+
|
88 |
+
if (x < centerX) {
|
89 |
+
selected_index = previous;
|
90 |
+
} else {
|
91 |
+
selected_index = next;
|
92 |
+
}
|
93 |
+
}
|
94 |
+
|
95 |
+
function on_keydown(e: KeyboardEvent): void {
|
96 |
+
switch (e.code) {
|
97 |
+
case "Escape":
|
98 |
+
e.preventDefault();
|
99 |
+
selected_index = null;
|
100 |
+
break;
|
101 |
+
case "ArrowLeft":
|
102 |
+
e.preventDefault();
|
103 |
+
selected_index = previous;
|
104 |
+
break;
|
105 |
+
case "ArrowRight":
|
106 |
+
e.preventDefault();
|
107 |
+
selected_index = next;
|
108 |
+
break;
|
109 |
+
default:
|
110 |
+
break;
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
function isFileData(obj: any): obj is FileData {
|
115 |
+
return typeof obj === "object" && obj !== null && "data" in obj;
|
116 |
+
}
|
117 |
+
|
118 |
+
function getHrefValue(selected: any): string {
|
119 |
+
if (isFileData(selected)) {
|
120 |
+
return selected.path;
|
121 |
+
} else if (typeof selected === "string") {
|
122 |
+
return selected;
|
123 |
+
} else if (Array.isArray(selected)) {
|
124 |
+
return getHrefValue(selected[0]);
|
125 |
+
}
|
126 |
+
return "";
|
127 |
+
}
|
128 |
+
|
129 |
+
$: {
|
130 |
+
if (selected_index !== old_selected_index) {
|
131 |
+
old_selected_index = selected_index;
|
132 |
+
if (selected_index !== null) {
|
133 |
+
dispatch("select", {
|
134 |
+
index: selected_index,
|
135 |
+
value: _value?.[selected_index]
|
136 |
+
});
|
137 |
+
}
|
138 |
+
}
|
139 |
+
}
|
140 |
+
|
141 |
+
$: if (allow_preview) {
|
142 |
+
scroll_to_img(selected_index);
|
143 |
+
}
|
144 |
+
|
145 |
+
let el: HTMLButtonElement[] = [];
|
146 |
+
let container_element: HTMLDivElement;
|
147 |
+
|
148 |
+
async function scroll_to_img(index: number | null): Promise<void> {
|
149 |
+
if (typeof index !== "number") return;
|
150 |
+
await tick();
|
151 |
+
|
152 |
+
if (el[index] === undefined) return;
|
153 |
+
|
154 |
+
el[index]?.focus();
|
155 |
+
|
156 |
+
const { left: container_left, width: container_width } =
|
157 |
+
container_element.getBoundingClientRect();
|
158 |
+
const { left, width } = el[index].getBoundingClientRect();
|
159 |
+
|
160 |
+
const relative_left = left - container_left;
|
161 |
+
|
162 |
+
const pos =
|
163 |
+
relative_left +
|
164 |
+
width / 2 -
|
165 |
+
container_width / 2 +
|
166 |
+
container_element.scrollLeft;
|
167 |
+
|
168 |
+
if (container_element && typeof container_element.scrollTo === "function") {
|
169 |
+
container_element.scrollTo({
|
170 |
+
left: pos < 0 ? 0 : pos,
|
171 |
+
behavior: "smooth"
|
172 |
+
});
|
173 |
+
}
|
174 |
+
}
|
175 |
+
|
176 |
+
let client_height = 0;
|
177 |
+
let window_height = 0;
|
178 |
+
</script>
|
179 |
+
|
180 |
+
<svelte:window bind:innerHeight={window_height} />
|
181 |
+
|
182 |
+
{#if show_label}
|
183 |
+
<BlockLabel {show_label} Icon={Image} label={label || "Gallery"} />
|
184 |
+
{/if}
|
185 |
+
{#if value === null || _value === null || _value.length === 0}
|
186 |
+
<Empty unpadded_box={true} size="large"><Image /></Empty>
|
187 |
+
{:else}
|
188 |
+
{#if selected_index !== null && allow_preview}
|
189 |
+
<button on:keydown={on_keydown} class="preview">
|
190 |
+
<div class="icon-buttons">
|
191 |
+
{#if show_download_button}
|
192 |
+
<a
|
193 |
+
href={getHrefValue(value[selected_index])}
|
194 |
+
target={window.__is_colab__ ? "_blank" : null}
|
195 |
+
download="image"
|
196 |
+
>
|
197 |
+
<IconButton Icon={Download} label={i18n("common.download")} />
|
198 |
+
</a>
|
199 |
+
{/if}
|
200 |
+
|
201 |
+
<ModifyUpload
|
202 |
+
{i18n}
|
203 |
+
absolute={false}
|
204 |
+
on:clear={() => (selected_index = null)}
|
205 |
+
/>
|
206 |
+
</div>
|
207 |
+
{#if _value[selected_index].image.mime_type === "video/mp4"}
|
208 |
+
<video
|
209 |
+
class="detailed-video"
|
210 |
+
data-testid="detailed-video"
|
211 |
+
controls
|
212 |
+
src={_value[selected_index].image.path}
|
213 |
+
title={_value[selected_index].image.alt_text}
|
214 |
+
preload="auto"
|
215 |
+
on:play
|
216 |
+
on:pause
|
217 |
+
on:ended
|
218 |
+
>
|
219 |
+
<track kind="captions" />
|
220 |
+
</video>
|
221 |
+
{:else}
|
222 |
+
<button
|
223 |
+
class="image-button"
|
224 |
+
on:click={(event) => handle_preview_click(event)}
|
225 |
+
style="height: calc(100% - {_value[selected_index].caption
|
226 |
+
? '80px'
|
227 |
+
: '60px'})"
|
228 |
+
aria-label="detailed view of selected image"
|
229 |
+
>
|
230 |
+
<img
|
231 |
+
data-testid="detailed-image"
|
232 |
+
src={_value[selected_index].image.url}
|
233 |
+
alt={_value[selected_index].caption || ""}
|
234 |
+
title={_value[selected_index].caption || null}
|
235 |
+
class:with-caption={!!_value[selected_index].caption}
|
236 |
+
loading="lazy"
|
237 |
+
/>
|
238 |
+
</button>
|
239 |
+
{/if}
|
240 |
+
{#if _value[selected_index]?.caption}
|
241 |
+
<caption class="caption">
|
242 |
+
{_value[selected_index].caption}
|
243 |
+
</caption>
|
244 |
+
{/if}
|
245 |
+
<div
|
246 |
+
bind:this={container_element}
|
247 |
+
class="thumbnails scroll-hide"
|
248 |
+
data-testid="container_el"
|
249 |
+
>
|
250 |
+
{#each _value as media, i}
|
251 |
+
<button
|
252 |
+
bind:this={el[i]}
|
253 |
+
on:click={() => (selected_index = i)}
|
254 |
+
class="thumbnail-item thumbnail-small"
|
255 |
+
class:selected={selected_index === i}
|
256 |
+
aria-label={"Thumbnail " + (i + 1) + " of " + _value.length}
|
257 |
+
>
|
258 |
+
<img
|
259 |
+
src={media.image.url}
|
260 |
+
title={media.caption || null}
|
261 |
+
data-testid={"thumbnail " + (i + 1)}
|
262 |
+
alt=""
|
263 |
+
loading="lazy"
|
264 |
+
/>
|
265 |
+
</button>
|
266 |
+
{/each}
|
267 |
+
</div>
|
268 |
+
</button>
|
269 |
+
{/if}
|
270 |
+
|
271 |
+
<div
|
272 |
+
bind:clientHeight={client_height}
|
273 |
+
class="grid-wrap"
|
274 |
+
class:fixed-height={!height || height == "auto"}
|
275 |
+
>
|
276 |
+
<div
|
277 |
+
class="grid-container"
|
278 |
+
style="--grid-cols:{columns}; --grid-rows:{rows}; --object-fit: {object_fit}; height: {height};"
|
279 |
+
class:pt-6={show_label}
|
280 |
+
>
|
281 |
+
{#if show_share_button}
|
282 |
+
<div class="icon-button">
|
283 |
+
<ShareButton
|
284 |
+
{i18n}
|
285 |
+
on:share
|
286 |
+
on:error
|
287 |
+
value={_value}
|
288 |
+
formatter={format_gallery_for_sharing}
|
289 |
+
/>
|
290 |
+
</div>
|
291 |
+
{/if}
|
292 |
+
{#each _value as entry, i}
|
293 |
+
<button
|
294 |
+
class="thumbnail-item thumbnail-lg"
|
295 |
+
class:selected={selected_index === i}
|
296 |
+
on:click={() => (selected_index = i)}
|
297 |
+
aria-label={"Thumbnail " + (i + 1) + " of " + _value.length}
|
298 |
+
>
|
299 |
+
|
300 |
+
{#if entry.image.mime_type === "video/mp4"}
|
301 |
+
<video
|
302 |
+
class="detailed-video"
|
303 |
+
data-testid="detailed-video"
|
304 |
+
controls
|
305 |
+
src={entry.image.path}
|
306 |
+
title={entry.image.alt_text}
|
307 |
+
preload="auto"
|
308 |
+
on:play
|
309 |
+
on:pause
|
310 |
+
on:ended
|
311 |
+
>
|
312 |
+
<track kind="captions" />
|
313 |
+
</video>
|
314 |
+
{:else}
|
315 |
+
<img
|
316 |
+
alt={entry.caption || ""}
|
317 |
+
src={typeof entry.image === "string"
|
318 |
+
? entry.image
|
319 |
+
: entry.image.url}
|
320 |
+
loading="lazy"
|
321 |
+
/>
|
322 |
+
{/if}
|
323 |
+
{#if entry.caption}
|
324 |
+
<div class="caption-label">
|
325 |
+
{entry.caption}
|
326 |
+
</div>
|
327 |
+
{/if}
|
328 |
+
</button>
|
329 |
+
{/each}
|
330 |
+
</div>
|
331 |
+
</div>
|
332 |
+
{/if}
|
333 |
+
|
334 |
+
<style lang="postcss">
|
335 |
+
.preview {
|
336 |
+
display: flex;
|
337 |
+
position: absolute;
|
338 |
+
top: 0px;
|
339 |
+
right: 0px;
|
340 |
+
bottom: 0px;
|
341 |
+
left: 0px;
|
342 |
+
flex-direction: column;
|
343 |
+
z-index: var(--layer-2);
|
344 |
+
backdrop-filter: blur(8px);
|
345 |
+
background: var(--background-fill-primary);
|
346 |
+
height: var(--size-full);
|
347 |
+
}
|
348 |
+
|
349 |
+
.fixed-height {
|
350 |
+
min-height: var(--size-80);
|
351 |
+
max-height: 55vh;
|
352 |
+
}
|
353 |
+
|
354 |
+
@media (--screen-xl) {
|
355 |
+
.fixed-height {
|
356 |
+
min-height: 450px;
|
357 |
+
}
|
358 |
+
}
|
359 |
+
.detailed-video {
|
360 |
+
height: calc(100% - 60px);
|
361 |
+
width: 100%;
|
362 |
+
display: flex;
|
363 |
+
}
|
364 |
+
|
365 |
+
.image-button {
|
366 |
+
height: calc(100% - 60px);
|
367 |
+
width: 100%;
|
368 |
+
display: flex;
|
369 |
+
}
|
370 |
+
.preview img {
|
371 |
+
width: var(--size-full);
|
372 |
+
height: var(--size-full);
|
373 |
+
object-fit: contain;
|
374 |
+
}
|
375 |
+
|
376 |
+
.preview img.with-caption {
|
377 |
+
height: var(--size-full);
|
378 |
+
}
|
379 |
+
|
380 |
+
.caption {
|
381 |
+
padding: var(--size-2) var(--size-3);
|
382 |
+
overflow: hidden;
|
383 |
+
color: var(--block-label-text-color);
|
384 |
+
font-weight: var(--weight-semibold);
|
385 |
+
text-align: center;
|
386 |
+
text-overflow: ellipsis;
|
387 |
+
white-space: nowrap;
|
388 |
+
align-self: center;
|
389 |
+
}
|
390 |
+
|
391 |
+
.thumbnails {
|
392 |
+
display: flex;
|
393 |
+
position: absolute;
|
394 |
+
bottom: 0;
|
395 |
+
justify-content: center;
|
396 |
+
align-items: center;
|
397 |
+
gap: var(--spacing-lg);
|
398 |
+
width: var(--size-full);
|
399 |
+
height: var(--size-14);
|
400 |
+
overflow-x: scroll;
|
401 |
+
}
|
402 |
+
|
403 |
+
.thumbnail-item {
|
404 |
+
--ring-color: transparent;
|
405 |
+
position: relative;
|
406 |
+
box-shadow:
|
407 |
+
0 0 0 2px var(--ring-color),
|
408 |
+
var(--shadow-drop);
|
409 |
+
border: 1px solid var(--border-color-primary);
|
410 |
+
border-radius: var(--button-small-radius);
|
411 |
+
background: var(--background-fill-secondary);
|
412 |
+
aspect-ratio: var(--ratio-square);
|
413 |
+
width: var(--size-full);
|
414 |
+
height: var(--size-full);
|
415 |
+
overflow: clip;
|
416 |
+
}
|
417 |
+
|
418 |
+
.thumbnail-item:hover {
|
419 |
+
--ring-color: var(--color-accent);
|
420 |
+
filter: brightness(1.1);
|
421 |
+
}
|
422 |
+
|
423 |
+
.thumbnail-item.selected {
|
424 |
+
--ring-color: var(--color-accent);
|
425 |
+
}
|
426 |
+
|
427 |
+
.thumbnail-small {
|
428 |
+
flex: none;
|
429 |
+
transform: scale(0.9);
|
430 |
+
transition: 0.075s;
|
431 |
+
width: var(--size-9);
|
432 |
+
height: var(--size-9);
|
433 |
+
}
|
434 |
+
|
435 |
+
.thumbnail-small.selected {
|
436 |
+
--ring-color: var(--color-accent);
|
437 |
+
transform: scale(1);
|
438 |
+
border-color: var(--color-accent);
|
439 |
+
}
|
440 |
+
|
441 |
+
.thumbnail-small > img {
|
442 |
+
width: var(--size-full);
|
443 |
+
height: var(--size-full);
|
444 |
+
overflow: hidden;
|
445 |
+
object-fit: var(--object-fit);
|
446 |
+
}
|
447 |
+
|
448 |
+
.grid-wrap {
|
449 |
+
position: relative;
|
450 |
+
padding: var(--size-2);
|
451 |
+
height: var(--size-full);
|
452 |
+
overflow-y: scroll;
|
453 |
+
}
|
454 |
+
|
455 |
+
.grid-container {
|
456 |
+
display: grid;
|
457 |
+
position: relative;
|
458 |
+
grid-template-rows: repeat(var(--grid-rows), minmax(100px, 1fr));
|
459 |
+
grid-template-columns: repeat(var(--grid-cols), minmax(100px, 1fr));
|
460 |
+
grid-auto-rows: minmax(100px, 1fr);
|
461 |
+
gap: var(--spacing-lg);
|
462 |
+
}
|
463 |
+
|
464 |
+
.thumbnail-lg > img {
|
465 |
+
width: var(--size-full);
|
466 |
+
height: var(--size-full);
|
467 |
+
overflow: hidden;
|
468 |
+
object-fit: var(--object-fit);
|
469 |
+
}
|
470 |
+
|
471 |
+
.thumbnail-lg:hover .caption-label {
|
472 |
+
opacity: 0.5;
|
473 |
+
}
|
474 |
+
|
475 |
+
.caption-label {
|
476 |
+
position: absolute;
|
477 |
+
right: var(--block-label-margin);
|
478 |
+
bottom: var(--block-label-margin);
|
479 |
+
z-index: var(--layer-1);
|
480 |
+
border-top: 1px solid var(--border-color-primary);
|
481 |
+
border-left: 1px solid var(--border-color-primary);
|
482 |
+
border-radius: var(--block-label-radius);
|
483 |
+
background: var(--background-fill-secondary);
|
484 |
+
padding: var(--block-label-padding);
|
485 |
+
max-width: 80%;
|
486 |
+
overflow: hidden;
|
487 |
+
font-size: var(--block-label-text-size);
|
488 |
+
text-align: left;
|
489 |
+
text-overflow: ellipsis;
|
490 |
+
white-space: nowrap;
|
491 |
+
}
|
492 |
+
|
493 |
+
.icon-button {
|
494 |
+
position: absolute;
|
495 |
+
top: 0px;
|
496 |
+
right: 0px;
|
497 |
+
z-index: var(--layer-1);
|
498 |
+
}
|
499 |
+
|
500 |
+
.icon-buttons {
|
501 |
+
display: flex;
|
502 |
+
position: absolute;
|
503 |
+
right: 0;
|
504 |
+
}
|
505 |
+
|
506 |
+
.icon-buttons a {
|
507 |
+
margin: var(--size-1) 0;
|
508 |
+
}
|
509 |
+
</style>
|
src/frontend/shared/utils.ts
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { uploadToHuggingFace } from "@gradio/utils";
|
2 |
+
import type { FileData } from "@gradio/client";
|
3 |
+
|
4 |
+
export async function format_gallery_for_sharing(
|
5 |
+
value: [FileData, string | null][] | null
|
6 |
+
): Promise<string> {
|
7 |
+
if (!value) return "";
|
8 |
+
let urls = await Promise.all(
|
9 |
+
value.map(async ([image, _]) => {
|
10 |
+
if (image === null || !image.url) return "";
|
11 |
+
return await uploadToHuggingFace(image.url, "url");
|
12 |
+
})
|
13 |
+
);
|
14 |
+
|
15 |
+
return `<div style="display: flex; flex-wrap: wrap; gap: 16px">${urls
|
16 |
+
.map((url) => `<img src="${url}" style="height: 400px" />`)
|
17 |
+
.join("")}</div>`;
|
18 |
+
}
|
src/pyproject.toml
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[build-system]
|
2 |
+
requires = [
|
3 |
+
"hatchling",
|
4 |
+
"hatch-requirements-txt",
|
5 |
+
"hatch-fancy-pypi-readme>=22.5.0",
|
6 |
+
]
|
7 |
+
build-backend = "hatchling.build"
|
8 |
+
|
9 |
+
[project]
|
10 |
+
name = "gradio_videogallery"
|
11 |
+
version = "0.0.1"
|
12 |
+
description = "Python library for easily interacting with trained machine learning models"
|
13 |
+
readme = "README.md"
|
14 |
+
license = "Apache-2.0"
|
15 |
+
requires-python = ">=3.8"
|
16 |
+
authors = [{ name = "YOUR NAME", email = "YOUREMAIL@domain.com" }]
|
17 |
+
keywords = [
|
18 |
+
"machine learning",
|
19 |
+
"reproducibility",
|
20 |
+
"visualization",
|
21 |
+
"gradio",
|
22 |
+
"gradio custom component",
|
23 |
+
"gradio-template-Gallery"
|
24 |
+
]
|
25 |
+
# Add dependencies here
|
26 |
+
dependencies = ["gradio>=4.0,<5.0"]
|
27 |
+
classifiers = [
|
28 |
+
'Development Status :: 3 - Alpha',
|
29 |
+
'License :: OSI Approved :: Apache Software License',
|
30 |
+
'Operating System :: OS Independent',
|
31 |
+
'Programming Language :: Python :: 3',
|
32 |
+
'Programming Language :: Python :: 3 :: Only',
|
33 |
+
'Programming Language :: Python :: 3.8',
|
34 |
+
'Programming Language :: Python :: 3.9',
|
35 |
+
'Programming Language :: Python :: 3.10',
|
36 |
+
'Programming Language :: Python :: 3.11',
|
37 |
+
'Topic :: Scientific/Engineering',
|
38 |
+
'Topic :: Scientific/Engineering :: Artificial Intelligence',
|
39 |
+
'Topic :: Scientific/Engineering :: Visualization',
|
40 |
+
]
|
41 |
+
|
42 |
+
[project.optional-dependencies]
|
43 |
+
dev = ["build", "twine"]
|
44 |
+
|
45 |
+
[tool.hatch.build]
|
46 |
+
artifacts = ["/backend/gradio_videogallery/templates", "*.pyi", "backend/gradio_videogallery/templates"]
|
47 |
+
|
48 |
+
[tool.hatch.build.targets.wheel]
|
49 |
+
packages = ["/backend/gradio_videogallery"]
|