Upload 2 files
Browse files- app.py +14 -6
- requirements.txt +5 -3
app.py
CHANGED
|
@@ -81,16 +81,24 @@ def ensure_data_ready(data_dir: Path, checkpoints: list) -> bool:
|
|
| 81 |
"""Ensure data and checkpoints are downloaded."""
|
| 82 |
print(f"Checking for existing data in {data_dir.absolute()}...")
|
| 83 |
|
| 84 |
-
# Check which models have data (config + embeddings)
|
| 85 |
models_with_data = []
|
| 86 |
for model in ["dmd2", "edm"]:
|
| 87 |
config_path = data_dir / model / "config.json"
|
| 88 |
embeddings_dir = data_dir / model / "embeddings"
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
if not models_with_data:
|
| 96 |
print("Data not found, downloading...")
|
|
|
|
| 81 |
"""Ensure data and checkpoints are downloaded."""
|
| 82 |
print(f"Checking for existing data in {data_dir.absolute()}...")
|
| 83 |
|
| 84 |
+
# Check which models have data (config + embeddings + images)
|
| 85 |
models_with_data = []
|
| 86 |
for model in ["dmd2", "edm"]:
|
| 87 |
config_path = data_dir / model / "config.json"
|
| 88 |
embeddings_dir = data_dir / model / "embeddings"
|
| 89 |
+
images_dir = data_dir / model / "images" / "imagenet_real"
|
| 90 |
+
|
| 91 |
+
if not config_path.exists():
|
| 92 |
+
continue
|
| 93 |
+
if not embeddings_dir.exists():
|
| 94 |
+
continue
|
| 95 |
+
|
| 96 |
+
csv_files = list(embeddings_dir.glob("*.csv"))
|
| 97 |
+
png_files = list(images_dir.glob("sample_*.png")) if images_dir.exists() else []
|
| 98 |
+
|
| 99 |
+
if csv_files and png_files:
|
| 100 |
+
models_with_data.append(model)
|
| 101 |
+
print(f" Found {model}: {len(csv_files)} csv, {len(png_files)} images")
|
| 102 |
|
| 103 |
if not models_with_data:
|
| 104 |
print("Data not found, downloading...")
|
requirements.txt
CHANGED
|
@@ -5,20 +5,22 @@ git+https://github.com/mckellcarter/diffviews.git
|
|
| 5 |
# Core dependencies
|
| 6 |
torch>=2.0.0
|
| 7 |
numpy>=1.21.0
|
| 8 |
-
numba==0.58.1
|
| 9 |
pandas>=1.5.0
|
| 10 |
pillow>=9.0.0
|
| 11 |
scikit-learn>=1.0.0
|
| 12 |
umap-learn>=0.5.0
|
| 13 |
tqdm>=4.60.0
|
| 14 |
|
|
|
|
|
|
|
|
|
|
| 15 |
# Visualization
|
| 16 |
gradio>=4.0.0
|
| 17 |
plotly>=5.18.0
|
| 18 |
matplotlib>=3.5.0
|
| 19 |
|
| 20 |
-
# HuggingFace Hub for
|
| 21 |
-
huggingface_hub>=0.19.0,<0.28.0
|
| 22 |
|
| 23 |
# Optional but useful
|
| 24 |
scipy>=1.7.0
|
|
|
|
| 5 |
# Core dependencies
|
| 6 |
torch>=2.0.0
|
| 7 |
numpy>=1.21.0
|
|
|
|
| 8 |
pandas>=1.5.0
|
| 9 |
pillow>=9.0.0
|
| 10 |
scikit-learn>=1.0.0
|
| 11 |
umap-learn>=0.5.0
|
| 12 |
tqdm>=4.60.0
|
| 13 |
|
| 14 |
+
# Numba pinned for UMAP pickle compatibility
|
| 15 |
+
numba==0.58.1
|
| 16 |
+
|
| 17 |
# Visualization
|
| 18 |
gradio>=4.0.0
|
| 19 |
plotly>=5.18.0
|
| 20 |
matplotlib>=3.5.0
|
| 21 |
|
| 22 |
+
# HuggingFace Hub - pinned for Gradio 6 compatibility
|
| 23 |
+
huggingface_hub>=0.19.0,<0.28.0
|
| 24 |
|
| 25 |
# Optional but useful
|
| 26 |
scipy>=1.7.0
|