Add README.md for browser implementation
Browse files
README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DeOldify Browser Integration
|
| 2 |
+
|
| 3 |
+
This directory contains a browser-based implementation of DeOldify using ONNX Runtime Web. It allows you to run colorization models directly in your web browser without a backend server (after the model is downloaded).
|
| 4 |
+
|
| 5 |
+
## ⚠️ Important: How to Run
|
| 6 |
+
|
| 7 |
+
Due to browser security policies (CORS), **you cannot simply double-click the HTML files** to run them. You must serve them via a local HTTP server.
|
| 8 |
+
|
| 9 |
+
### Quick Start (Windows/Linux/Mac)
|
| 10 |
+
|
| 11 |
+
If you have Python installed (which is likely if you're using DeOldify), simply run:
|
| 12 |
+
|
| 13 |
+
```bash
|
| 14 |
+
# Run this command in your terminal within this directory
|
| 15 |
+
python -m http.server 8000
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
Then open your browser and visit:
|
| 19 |
+
* [http://localhost:8000](http://localhost:8000)
|
| 20 |
+
|
| 21 |
+
### Using the Helper Script (Windows)
|
| 22 |
+
|
| 23 |
+
We've provided a PowerShell script to make this easy:
|
| 24 |
+
|
| 25 |
+
1. Right-click `serve.ps1` and select "Run with PowerShell"
|
| 26 |
+
2. Or run it from the terminal: `.\serve.ps1`
|
| 27 |
+
|
| 28 |
+
## Available Models
|
| 29 |
+
|
| 30 |
+
* **Artistic Model**: High quality, vibrant colors. Larger download (~243 MB).
|
| 31 |
+
* **Quantized Model**: Faster, smaller download (~61 MB), slightly lower quality.
|
| 32 |
+
|
| 33 |
+
## Troubleshooting
|
| 34 |
+
|
| 35 |
+
**"Failed to fetch" or CORS Errors:**
|
| 36 |
+
If you see an error about CORS or "Failed to fetch" in the status log, it means you are likely trying to open the file directly (`file:///...`). Please use the HTTP server method described above.
|
| 37 |
+
|
| 38 |
+
**Memory Issues:**
|
| 39 |
+
The artistic model requires a significant amount of RAM. If the tab crashes, try closing other tabs or using the Quantized model.
|