A newer version of the Gradio SDK is available:
6.1.0
COLMAP Installation Fix for Hugging Face Spaces
Problem
COLMAP cannot be installed via pip - it's a system-level dependency.
Solution
Files to Upload to Your Hugging Face Space:
- requirements.txt - Updated (removed colmap)
- packages.txt - NEW FILE (installs COLMAP via apt-get)
- app-10.py - Your existing app (no changes needed)
Steps to Fix:
- In your Hugging Face Space repository, replace the old
requirements.txtwith the new one - Add the new
packages.txtfile to the root directory of your Space - Commit the changes
What These Files Do:
requirements.txt: Installs Python packages via pip
- Removed:
colmap(not a Python package!)
- Removed:
packages.txt: Installs system packages via apt-get
- Added:
colmap(system dependency)
- Added:
Build Time Warning
Installing COLMAP will increase your Space's build time by 1-3 minutes. This is normal.
GPU Requirements
Your app uses:
- COLMAP (GPU-accelerated feature extraction)
- NeRF training (requires GPU)
Make sure your Space is set to use GPU hardware:
- Go to Space Settings
- Select "GPU" under Hardware
- Choose an appropriate GPU tier (T4 or better recommended)
Testing COLMAP Installation
After the Space builds successfully, you can verify COLMAP is installed by checking the logs. Your app already has a check at line 94:
result = subprocess.run(["which", "colmap"], capture_output=True, text=True)
if result.returncode != 0:
return {"status": "colmap_not_found", "message": "COLMAP not installed"}
Alternative: Custom Dockerfile
If packages.txt doesn't work for some reason, you can use a custom Dockerfile instead. Let me know if you need help with that approach.
Troubleshooting
If COLMAP still not found:
- Check the build logs for apt-get errors
- Verify
packages.txtis in the root directory - Make sure there are no extra spaces in packages.txt
If nerfstudio doesn't work:
You may need to add additional system dependencies to packages.txt:
colmap
libgl1-mesa-glx
libglib2.0-0
Memory Issues:
NeRF training is memory-intensive. If you get OOM errors:
- Reduce
max_frames_sliderdefault (try 50 instead of 100) - Reduce
iterations_sliderdefault (try 1000 instead of 2000) - Use a larger GPU tier in Space settings
Expected Build Output
After fixing, your build should show:
--> RUN apt-get update && apt-get install -y colmap ...
✓ Successfully installed colmap
--> RUN pip install --no-cache-dir -r requirements.txt
✓ Successfully installed gradio opencv-python-headless numpy Pillow nerfstudio torch torchvision
Questions?
If you continue having issues, check:
- Are both files in the root directory?
- Is packages.txt correctly formatted (just "colmap" on one line)?
- Did you commit and push the changes?