nalexand commited on
Commit
83330dd
·
verified ·
1 Parent(s): cd934e0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +94 -0
README.md CHANGED
@@ -1,3 +1,97 @@
1
  ---
2
  license: cc
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: cc
3
+ datasets:
4
+ - nalexand/upscaler_unblur
5
+ tags:
6
+ - image-to-image
7
+ - video-to-video
8
+ - upscale
9
+ - upscaler
10
+ - unblur
11
  ---
12
+
13
+
14
+
15
+
16
+ <h1>Go Image &amp; Video Upscaler</h1>
17
+
18
+ <p>Project link: <a href="https://github.com/nalexand/video_upscaler">https://github.com/nalexand/video_upscaler</a></p>
19
+
20
+ <p>This project is a high-performance, command-line tool written in Go for upscaling images and videos. It utilizes a custom, pre-trained model to perform a 3x upscale, with a focus on unblurring and denoising the source material. The processing is done in parallel to leverage multi-core CPUs for significant speed improvements.</p>
21
+
22
+ <h2>Features</h2>
23
+ <ul>
24
+ <li><strong>3x Image Upscaling</strong>: Enhance the resolution of images (PNG) by a factor of 3.</li>
25
+ <li><strong>3x Video Upscaling</strong>: Process videos by extracting frames, upscaling them individually, and reassembling them into a high-resolution video file.</li>
26
+ <li><strong>Unblur &amp; Denoise</strong>: The included model is trained not just to enlarge, but also to correct common imperfections like blur and noise.</li>
27
+ <li><strong>High Performance</strong>: Leverages Go's concurrency features to process image rows or video frames in parallel across all available CPU cores.</li>
28
+ <li><strong>Command-Line Interface</strong>: Simple and clear flags for easy operation on local files.</li>
29
+ <li><strong>Self-Contained Model</strong>: Uses a pre-trained model stored in a <code>.gob</code> file, which is Go's native binary format, download here: https://huggingface.co/datasets/nalexand/upscaler_unblur/tree/main</li>
30
+ </ul>
31
+
32
+ <h2>Prerequisites</h2>
33
+ <p>Before using this tool, you must have the following software installed on your system:</p>
34
+ <ol>
35
+ <li>
36
+ <strong>Go</strong>: The Go programming language (version 1.18 or newer recommended). You can download it from <a href="https://golang.org/" target="_blank" rel="noopener noreferrer">golang.org</a>.
37
+ </li>
38
+ <li>
39
+ <strong>FFmpeg</strong>: A powerful multimedia framework used to extract frames from the input video and reassemble them with audio.
40
+ <ul>
41
+ <li>Installation instructions can be found on the <a href="https://ffmpeg.org/download.html" target="_blank" rel="noopener noreferrer">official FFmpeg website</a>.</li>
42
+ <li>Ensure that both <code>ffmpeg</code> and <code>ffprobe</code> are available in your system's <code>PATH</code>. You can verify this by running <code>ffmpeg -version</code> and <code>ffprobe -version</code> in your terminal.</li>
43
+ </ul>
44
+ </li>
45
+ </ol>
46
+
47
+ <h2>Installation &amp; Setup</h2>
48
+ <ol>
49
+ <li>
50
+ <strong>Clone the Repository</strong>
51
+ <pre><code>git clone &lt;repository-url&gt;
52
+ cd &lt;repository-directory&gt;</code></pre>
53
+ </li>
54
+ <li>
55
+ <strong>Get the Model File</strong>
56
+ <p>This program requires the model file <code>unblur_denoice_shared_model_x3_20.gob</code> to be present in the same directory as the executable. You can dowmload it here: https://huggingface.co/datasets/nalexand/upscaler_unblur/tree/main</p>
57
+ </li>
58
+ <li>
59
+ <strong>Build the Executable</strong>
60
+ <p>Create a binary from the source code. This command will produce an executable file (e.g., <code>unblur_server_binary</code> on Linux/macOS or <code>unblur_server_binary.exe</code> on Windows).</p>
61
+ <pre><code>go build -o unblur_server_binary .</code></pre>
62
+ </li>
63
+ </ol>
64
+
65
+ <h2>Usage</h2>
66
+ <p>The tool is operated via command-line flags. The primary mode is <code>upscale</code>.</p>
67
+
68
+ <h3>Image Upscaling</h3>
69
+ <p>To upscale a single image:</p>
70
+ <pre><code>./unblur_server_binary -mode=upscale -lr=input.png -out=output_upscaled.png</code></pre>
71
+ <ul>
72
+ <li><code>-mode=upscale</code>: Specifies the operation mode.</li>
73
+ <li><code>-lr=&lt;path&gt;</code>: Path to the low-resolution input image.</li>
74
+ <li><code>-out=&lt;path&gt;</code>: Path for the resulting high-resolution output image.</li>
75
+ </ul>
76
+
77
+ <h3>Video Upscaling</h3>
78
+ <p>To upscale a video file:</p>
79
+ <pre><code>./unblur_server_binary -mode=upscale -videoin=my_video.mp4 -videoout=my_video_upscaled.mp4</code></pre>
80
+ <ul>
81
+ <li><code>-videoin=&lt;path&gt;</code>: Path to the low-resolution input video.</li>
82
+ <li><code>-videoout=&lt;path&gt;</code>: Path for the resulting high-resolution output video.</li>
83
+ </ul>
84
+ <p>The tool will automatically handle:</p>
85
+ <ul>
86
+ <li>Creating a temporary directory for frames.</li>
87
+ <li>Extracting all frames from the input video using <code>ffmpeg</code>.</li>
88
+ <li>Upscaling each frame in parallel.</li>
89
+ <li>Reassembling the upscaled frames into a new video.</li>
90
+ <li>Copying the audio track from the original video to the final output.</li>
91
+ </ul>
92
+
93
+ <h3>Using a Different Model</h3>
94
+ <p>You can specify a different model file using the <code>-model</code> flag:</p>
95
+ <pre><code>./unblur_server_binary -mode=upscale -lr=input.jpg -model=another_model.gob -out=output.png</code></pre>
96
+
97
+ <hr>