Spaces:
Running
Running
github-actions[bot] commited on
Commit ·
719f57d
1
Parent(s): a2d85ea
Deploy hyper3labs/HyperView from Hyper3Labs/hyperview-spaces@dbde661
Browse files- Dockerfile +3 -3
- README.md +2 -2
- demo.py +8 -5
Dockerfile
CHANGED
|
@@ -21,14 +21,14 @@ WORKDIR $HOME/app
|
|
| 21 |
|
| 22 |
RUN pip install --upgrade pip
|
| 23 |
|
| 24 |
-
ARG HYPERVIEW_VERSION=0.
|
| 25 |
-
ARG HYPER_MODELS_VERSION=0.
|
| 26 |
|
| 27 |
# Install CPU-only PyTorch first so the Space does not pull the default CUDA bundle,
|
| 28 |
# then pin released HyperView packages so Docker cache cannot hold an older release.
|
| 29 |
RUN pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
|
| 30 |
RUN pip install "hyperview==${HYPERVIEW_VERSION}" && python -c "import hyperview; print('hyperview', hyperview.__version__)"
|
| 31 |
-
RUN pip install "hyper-models==${HYPER_MODELS_VERSION}" && python -c "import hyper_models; print('hyper_models', hyper_models.__version__)"
|
| 32 |
|
| 33 |
COPY --chown=user demo.py ./demo.py
|
| 34 |
|
|
|
|
| 21 |
|
| 22 |
RUN pip install --upgrade pip
|
| 23 |
|
| 24 |
+
ARG HYPERVIEW_VERSION=0.6.2
|
| 25 |
+
ARG HYPER_MODELS_VERSION=0.3.0
|
| 26 |
|
| 27 |
# Install CPU-only PyTorch first so the Space does not pull the default CUDA bundle,
|
| 28 |
# then pin released HyperView packages so Docker cache cannot hold an older release.
|
| 29 |
RUN pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
|
| 30 |
RUN pip install "hyperview==${HYPERVIEW_VERSION}" && python -c "import hyperview; print('hyperview', hyperview.__version__)"
|
| 31 |
+
RUN pip install "hyper-models[ml]==${HYPER_MODELS_VERSION}" && python -c "import hyper_models; print('hyper_models', hyper_models.__version__)"
|
| 32 |
|
| 33 |
COPY --chown=user demo.py ./demo.py
|
| 34 |
|
README.md
CHANGED
|
@@ -25,8 +25,8 @@ rights holder.
|
|
| 25 |
|
| 26 |
The Docker image installs released packages from PyPI:
|
| 27 |
|
| 28 |
-
- `hyperview==0.
|
| 29 |
-
- `hyper-models==0.
|
| 30 |
|
| 31 |
## Dataset
|
| 32 |
|
|
|
|
| 25 |
|
| 26 |
The Docker image installs released packages from PyPI:
|
| 27 |
|
| 28 |
+
- `hyperview==0.6.2`
|
| 29 |
+
- `hyper-models[ml]==0.3.0`
|
| 30 |
|
| 31 |
## Dataset
|
| 32 |
|
demo.py
CHANGED
|
@@ -12,6 +12,7 @@ from datasets import load_dataset
|
|
| 12 |
from PIL import Image, ImageOps
|
| 13 |
|
| 14 |
import hyperview as hv
|
|
|
|
| 15 |
|
| 16 |
SPACE_HOST = "0.0.0.0"
|
| 17 |
SPACE_PORT = 7860
|
|
@@ -154,11 +155,13 @@ def add_inat24_samples(dataset: hv.Dataset) -> None:
|
|
| 154 |
metadata["source_dataset"] = HF_DATASET
|
| 155 |
metadata["sample_strategy"] = "stratified_by_inat24_supercategory"
|
| 156 |
|
| 157 |
-
dataset.
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
|
|
|
|
|
|
| 162 |
)
|
| 163 |
counts[group] += 1
|
| 164 |
existing_ids.add(sample_id)
|
|
|
|
| 12 |
from PIL import Image, ImageOps
|
| 13 |
|
| 14 |
import hyperview as hv
|
| 15 |
+
from hyperview.core.sample import Sample
|
| 16 |
|
| 17 |
SPACE_HOST = "0.0.0.0"
|
| 18 |
SPACE_PORT = 7860
|
|
|
|
| 155 |
metadata["source_dataset"] = HF_DATASET
|
| 156 |
metadata["sample_strategy"] = "stratified_by_inat24_supercategory"
|
| 157 |
|
| 158 |
+
dataset.add_sample(
|
| 159 |
+
Sample(
|
| 160 |
+
id=sample_id,
|
| 161 |
+
filepath=str(image_path),
|
| 162 |
+
label=group,
|
| 163 |
+
metadata=metadata,
|
| 164 |
+
),
|
| 165 |
)
|
| 166 |
counts[group] += 1
|
| 167 |
existing_ids.add(sample_id)
|