readme updated
Browse files
README.md
CHANGED
@@ -1,3 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# Image Colorization Application
|
2 |
|
3 |
This application provides a web-based interface for colorizing black and white images using DeOldify technology. It consists of a FastAPI backend for processing images and a Streamlit frontend for a user-friendly interface.
|
@@ -14,39 +25,50 @@ This application provides a web-based interface for colorizing black and white i
|
|
14 |
|
15 |
### Prerequisites
|
16 |
|
17 |
-
- Python 3.7 or higher
|
18 |
- CUDA-capable GPU (recommended for faster processing)
|
19 |
-
- Git
|
20 |
|
21 |
### Setup Instructions
|
22 |
|
23 |
1. **Clone the DeOldify repository inside your project directory:**
|
24 |
|
25 |
```bash
|
26 |
-
git clone https://
|
27 |
```
|
28 |
|
29 |
-
2. **
|
30 |
|
31 |
-
|
32 |
-
pip install -r requirements.txt
|
33 |
-
```
|
34 |
|
35 |
-
|
36 |
|
37 |
-
|
|
|
|
|
|
|
38 |
|
39 |
-
-
|
40 |
-
- Stable model: [ColorizeStable_gen.pth](https://www.dropbox.com/s/axsd2g85uyixaho/ColorizeStable_gen.pth?dl=0)
|
41 |
|
42 |
-
|
43 |
|
44 |
```bash
|
45 |
-
|
46 |
-
# Move the downloaded .pth files to the DeOldify/models directory
|
47 |
```
|
48 |
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
## Running the Application
|
52 |
|
@@ -66,25 +88,6 @@ streamlit run streamlit_app.py
|
|
66 |
|
67 |
This will open the web interface in your browser, typically at http://localhost:8501
|
68 |
|
69 |
-
## Troubleshooting
|
70 |
-
|
71 |
-
### Common Issues
|
72 |
-
|
73 |
-
#### ModuleNotFoundError: No module named 'deoldify'
|
74 |
-
|
75 |
-
This error indicates that the application cannot find the DeOldify module. Make sure:
|
76 |
-
|
77 |
-
- The DeOldify repository is cloned in the same directory as app.py
|
78 |
-
- You're running the commands from the root directory of the project, not from inside the DeOldify directory
|
79 |
-
|
80 |
-
#### CUDA/GPU-related errors
|
81 |
-
|
82 |
-
If you encounter CUDA errors:
|
83 |
-
|
84 |
-
- Make sure your GPU drivers are up to date
|
85 |
-
- Try running with a lower render factor
|
86 |
-
- Edit app.py to change `DeviceId.GPU0` to `DeviceId.CPU` if you don't have a GPU
|
87 |
-
|
88 |
## API Documentation
|
89 |
|
90 |
Once the FastAPI server is running, you can access the API documentation at:
|
@@ -118,7 +121,7 @@ The web application provides an intuitive interface for:
|
|
118 |
## Performance Tips
|
119 |
|
120 |
- If you encounter CUDA out-of-memory errors, try lowering the render factor
|
121 |
-
- For best results with the artistic model, a render factor of
|
122 |
- For the stable model, a render factor of 20-25 typically works well
|
123 |
|
124 |
## License
|
|
|
1 |
+
<table>
|
2 |
+
<tr>
|
3 |
+
<td align="center">Input (B&W)</td>
|
4 |
+
<td align="center">Colorized Output</td>
|
5 |
+
</tr>
|
6 |
+
<tr>
|
7 |
+
<td><img src="DeOldify/test_images/1910Finland.jpg" alt="Input Black and White Image" height=500/></td>
|
8 |
+
<td><img src="DeOldify/result_images/1910Finland.jpg" alt="Colorized Output Image" height=500/></td>
|
9 |
+
</tr>
|
10 |
+
</table>
|
11 |
+
|
12 |
# Image Colorization Application
|
13 |
|
14 |
This application provides a web-based interface for colorizing black and white images using DeOldify technology. It consists of a FastAPI backend for processing images and a Streamlit frontend for a user-friendly interface.
|
|
|
25 |
|
26 |
### Prerequisites
|
27 |
|
28 |
+
- Python 3.7 or higher ( preferred 3.10 )
|
29 |
- CUDA-capable GPU (recommended for faster processing)
|
30 |
+
- Git, Git-Lfs
|
31 |
|
32 |
### Setup Instructions
|
33 |
|
34 |
1. **Clone the DeOldify repository inside your project directory:**
|
35 |
|
36 |
```bash
|
37 |
+
git clone https://huggingface.co/sayed99/Image-Colorizer
|
38 |
```
|
39 |
|
40 |
+
2. **Set up the environment:**
|
41 |
|
42 |
+
You can set up the environment using either Conda (recommended) or pip.
|
|
|
|
|
43 |
|
44 |
+
- **Using Conda (Recommended):**
|
45 |
|
46 |
+
```bash
|
47 |
+
conda env create -f environment.yml
|
48 |
+
conda activate deoldify-env # Or whatever you named your environment
|
49 |
+
```
|
50 |
|
51 |
+
- **Using Pip:**
|
|
|
52 |
|
53 |
+
Make sure you have a compatible Python environment (3.7+).
|
54 |
|
55 |
```bash
|
56 |
+
pip install -r requirements.txt
|
|
|
57 |
```
|
58 |
|
59 |
+
This installs both the dependencies for our application and most of the dependencies needed for DeOldify.
|
60 |
+
|
61 |
+
## Directory Structure
|
62 |
+
|
63 |
+
- `DeOldify/`: Cloned repository containing the core DeOldify library.
|
64 |
+
- `models/`: Contains the downloaded `.pth` model weights.
|
65 |
+
- `input_images/`: Default location for uploaded images (can be configured).
|
66 |
+
- `output_images/` or `result_images/`: Default location for single colorized images.
|
67 |
+
- `multiple_renders/`: Default location for images generated using the multiple render factors feature.
|
68 |
+
- `app.py`: FastAPI backend server.
|
69 |
+
- `streamlit_app.py`: Streamlit frontend application.
|
70 |
+
- `requirements.txt`: Pip dependencies.
|
71 |
+
- `environment.yml`: Conda environment specification.
|
72 |
|
73 |
## Running the Application
|
74 |
|
|
|
88 |
|
89 |
This will open the web interface in your browser, typically at http://localhost:8501
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
## API Documentation
|
92 |
|
93 |
Once the FastAPI server is running, you can access the API documentation at:
|
|
|
121 |
## Performance Tips
|
122 |
|
123 |
- If you encounter CUDA out-of-memory errors, try lowering the render factor
|
124 |
+
- For best results with the artistic model, a render factor of 10-15 is recommended
|
125 |
- For the stable model, a render factor of 20-25 typically works well
|
126 |
|
127 |
## License
|