muhammadnoman76 commited on
Commit
dfe2bab
·
verified ·
1 Parent(s): af5a5d5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +117 -136
README.md CHANGED
@@ -1,137 +1,118 @@
1
- # MakeItColor: Image Colorization Model
2
-
3
- ## Model Description
4
- **MakeItColor** is a deep learning model designed for automatic image colorization. It accepts grayscale images as input and generates vivid, realistic colorized outputs. Built with a PyTorch-based Convolutional Neural Network (CNN) architecture, it is seamlessly integrated with the **ModelScope** framework for easy deployment across various applications.
5
-
6
- This model is inspired by and builds upon the work of [DDColor](https://github.com/piddnad/DDColor), utilizing a dual-encoder approach and trained on the **ImageNet-Val5k** dataset.
7
-
8
- ---
9
-
10
- ## Task
11
- - **Image Colorization**
12
-
13
- ## Framework
14
- - **PyTorch**, **ModelScope**
15
-
16
- ## Model Type
17
- - **Convolutional Neural Network (CNN)**
18
-
19
- ## Input
20
- - **Grayscale images** (single-channel)
21
-
22
- ## Output
23
- - **Colorized images** (RGB format)
24
-
25
- ---
26
-
27
- ## Installation
28
- Make sure you have **Python 3.7+** installed. Then, install the required dependencies:
29
-
30
- ```bash
31
- !pip install gradio
32
- !pip install opencv-python
33
- !pip install modelscope==1.12.0
34
- !pip install datasets==2.14.7
35
- !pip install pillow
36
- !pip install numpy
37
- !pip install gradio-imageslider
38
- ```
39
-
40
- ---
41
-
42
- ## Usage
43
-
44
- You can easily use **MakeItColor** through the ModelScope pipeline:
45
-
46
- ```python
47
- import cv2
48
- from modelscope.pipelines import pipeline
49
- from modelscope.utils.constant import Tasks
50
-
51
- # Initialize the colorization pipeline
52
- img_colorization = pipeline(Tasks.image_colorization, model='your-username/makeitcolor')
53
-
54
- # Load a grayscale image
55
- img_path = 'input.jpg'
56
-
57
- # Run colorization
58
- result = img_colorization(img_path)
59
-
60
- # Save the colorized image
61
- cv2.imwrite('result.png', result['output_img'])
62
- ```
63
-
64
- > **Note**:
65
- > - Ensure that the input image (`input.jpg`) is a proper grayscale (single-channel) image.
66
- > - The output (`result.png`) will be a standard RGB image.
67
-
68
- ---
69
-
70
- ## Model Files
71
-
72
- The repository contains the following files:
73
-
74
- - `pytorch_model.pt`: Pre-trained model weights.
75
- - `configuration.json`: Model configuration file for ModelScope integration.
76
- - `README.md`: This documentation file.
77
-
78
- ---
79
-
80
- ## Inference Requirements
81
-
82
- - **Hardware**:
83
- - CPU (supported)
84
- - GPU (recommended for faster inference)
85
-
86
- - **Software Dependencies**:
87
- - `modelscope`
88
- - `opencv-python`
89
- - `torch`
90
-
91
- ---
92
-
93
- ## Input Format
94
-
95
- - Grayscale images (`.png`, `.jpg`, etc.)
96
-
97
- ### Example
98
-
99
- 1. Prepare a grayscale image (e.g., `input.jpg`).
100
- 2. Run the provided example code.
101
- 3. Check the output file (`result.png`) for the colorized result.
102
-
103
- ---
104
-
105
- ## Limitations
106
-
107
- - The model may struggle with highly complex, ambiguous, or abstract grayscale images.
108
- - Performance and output quality depend on the clarity and details of the input.
109
- - Primarily optimized for **natural images**; results may vary for synthetic or artistic inputs.
110
-
111
- ---
112
-
113
- ## Credits
114
-
115
- This work builds upon and was inspired by the [DDColor project](https://github.com/piddnad/DDColor).
116
- **MakeItColor** leverages a dual-encoder strategy from DDColor and is trained on the **ImageNet-Val5k** dataset.
117
-
118
- Special thanks to the creators of DDColor for their foundational contributions.
119
-
120
- ---
121
-
122
- ## License
123
-
124
- This project is licensed under the **Apache License 2.0**.
125
-
126
- ---
127
-
128
- ## Contact
129
-
130
- For issues, questions, or feedback, feel free to:
131
-
132
- - Open an issue on the [Hugging Face repository](#).
133
- - Contact the maintainer directly at: **[muhammadnomanshafiq76@gmail.com](mailto:muhammadnomanshafiq76@gmail.com)**
134
-
135
- ---
136
-
137
  **Developed by Muhammad Noman**
 
1
+ # MakeItColor: Image Colorization Model
2
+
3
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/10raIuCBUhKCPqIuL_HiSQmkJJ9jbu2VC?usp=sharing)
4
+
5
+ ## Overview
6
+
7
+ **MakeItColor** is a deep learning model designed for automatic image colorization. It transforms grayscale images into vivid, realistic colorized outputs using a PyTorch-based Convolutional Neural Network (CNN) architecture integrated with the ModelScope framework.
8
+
9
+ This model builds upon the work of [DDColor](https://github.com/piddnad/DDColor), utilizing a dual-encoder approach and trained on the **ImageNet-Val5k** dataset.
10
+
11
+ ## Features
12
+
13
+ - **Task**: Image Colorization
14
+ - **Framework**: PyTorch, ModelScope
15
+ - **Architecture**: Convolutional Neural Network (CNN)
16
+ - **Input**: Grayscale images (single-channel)
17
+ - **Output**: Colorized images (RGB format)
18
+
19
+ ## Installation
20
+
21
+ Ensure you have **Python 3.7+** installed. Then, install the required dependencies:
22
+
23
+ ```bash
24
+ pip install opencv-python
25
+ pip install modelscope==1.12.0
26
+ pip install datasets==2.14.7
27
+ pip install pillow
28
+ pip install numpy
29
+ ```
30
+
31
+ ## Usage
32
+
33
+ ### ModelScope Pipeline
34
+
35
+ ```python
36
+ import cv2
37
+ from modelscope.pipelines import pipeline
38
+ from modelscope.utils.constant import Tasks
39
+ from huggingface_hub import snapshot_download
40
+
41
+ # Download the model files to a local directory
42
+ snapshot_download(repo_id="muhammadnoman76/makeitcolor", local_dir="./makeitcolor", repo_type="model")
43
+
44
+ # Initialize the colorization pipeline
45
+ img_colorization = pipeline(Tasks.image_colorization, model='./makeitcolor')
46
+
47
+ # Load a grayscale image
48
+ img_path = 'input.jpg'
49
+
50
+ # Run colorization
51
+ result = img_colorization(img_path)
52
+
53
+ # Save the colorized image
54
+ cv2.imwrite('result.png', result['output_img'])
55
+ ```
56
+
57
+ > **Note**:
58
+ > - Ensure that the input image (`input.jpg`) is a proper grayscale (single-channel) image.
59
+ > - The output (`result.png`) will be a standard RGB image.
60
+
61
+ ## Google Colab
62
+
63
+ For an interactive demonstration, try our [Google Colab notebook](https://colab.research.google.com/drive/10raIuCBUhKCPqIuL_HiSQmkJJ9jbu2VC?usp=sharing).
64
+
65
+ ## Model Files
66
+
67
+ The repository contains:
68
+ - `pytorch_model.pt`: Pre-trained model weights
69
+ - `configuration.json`: Model configuration file for ModelScope integration
70
+ - `README.md`: Documentation
71
+
72
+ ## Requirements
73
+
74
+ ### Hardware
75
+ - CPU (supported)
76
+ - GPU (recommended for faster inference)
77
+
78
+ ### Software Dependencies
79
+ - `modelscope`
80
+ - `opencv-python`
81
+ - `torch`
82
+
83
+ ## Input Format
84
+
85
+ - Grayscale images (`.png`, `.jpg`, etc.)
86
+
87
+ ### Example Workflow
88
+
89
+ 1. Prepare a grayscale image (e.g., `input.jpg`)
90
+ 2. Run the provided example code
91
+ 3. Check the output file (`result.png`) for the colorized result
92
+
93
+ ## Limitations
94
+
95
+ - May struggle with highly complex, ambiguous, or abstract grayscale images
96
+ - Performance and output quality depend on the clarity and details of the input
97
+ - Primarily optimized for natural images; results may vary for synthetic or artistic inputs
98
+
99
+ ## Credits
100
+
101
+ This work builds upon and was inspired by the [DDColor project](https://github.com/piddnad/DDColor).
102
+ **MakeItColor** leverages a dual-encoder strategy from DDColor and is trained on the **ImageNet-Val5k** dataset.
103
+
104
+ Special thanks to the creators of DDColor for their foundational contributions.
105
+
106
+ ## License
107
+
108
+ This project is licensed under the **Apache License 2.0**.
109
+
110
+ ## Contact
111
+
112
+ For issues, questions, or feedback:
113
+ - Open an issue on the Hugging Face repository
114
+ - Contact the maintainer directly at: [muhammadnomanshafiq76@gmail.com](mailto:muhammadnomanshafiq76@gmail.com)
115
+
116
+ ---
117
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  **Developed by Muhammad Noman**