- Published on
Leverage: MFS
Mobile Face Swap
- elevate synthesis frame speed by multiprocessing in video frame loop
- add upscale module โ FHD super resolution result
Experiment
Configuration
A/B test: multi-process vs multi-thread
- ๋ฉํฐํ๋ก์ธ์ค๋ก ์์ ํ ๊ฒฝ์ฐ ๋ ๋ฆฝ์ ์ผ๋ก ๋ฉ๋ชจ๋ฆฌ๊ฐ ๊ด๋ฆฌํ์ฌ ์์ ์ ์ผ๋ก ์ฒ๋ฆฌ๊ฐ ๋๋ค๋ ์ . ํ์ง๋ง ๋ฉ๋ชจ๋ฆฌ ๋ด context switching ์์ฃผ ์ผ์ด๋์ ์ค๋ฒํค๋๊ฐ ๋ฐ์ํ์ฌ ์ฑ๋ฅ์ ํ๊ฐ ์ผ์ด๋ ์ ์๋ค๋ ๋จ์ ์ ๊ฐ์ง๊ณ ์๋ค.
- ๋ฐ๋ฉด ๋ฉํฐ์ฐ๋ ๋ ์์์ ๊ณต์ ํ์ฌ ๋ฉ๋ชจ๋ฆฌ ์์ ์๋ชจ๊ฐ ๊ฐ์ํ๊ณ ๊ณต์ ๋ ๋ฉ๋ชจ๋ฆฌ๋ค ๋ณด๋ context switching ๋น ๋ฅด๋ค๋ ์ฅ์ ์ ๊ฐ์ง๊ณ ์๋ค. ํ์ง๋ง ๋ฐ๋๋ฝ์ด๋ ์ฐ๋ ๋ ํ๋ ๋ฌธ์ ๊ฐ ์ ์ฒด ํ๋ก์ธ์ค๊ฐ ์ํฅ์ ๋ฐ๋๋ค๋ ๋จ์ ์ ๊ฐ์ง๊ณ ์๋ค.
- source image: koo.png
- target video: test.mp4
Single process

Multi process

Multi thread

A/B test: High resolution module
Real-ESRGAN

Fast-SRGAN

Bicubic interpolation
Video Upscalers Benchmark
Video Upscalers Benchmark
The most extensive comparison of video super-resolution (VSR) algorithms by subjective quality
ADSBicubic++: Slim, Slimmer, Slimmest -- Designing an Industry-Grade Super-Resolution NetworkBicubic++: Slim, Slimmer, Slimmest -- Designing an Industry-Grade Super-Resolution Network
We propose a real-time and lightweight single-image super-resolution (SR) network named Bicubic++. Despite using spatial dimensions of the input image across the whole network, Bicubic++ first learns quick reversible downgraded and lower resolution features of the image in order to decrease the number of computations. We also construct a training pipeline, where we apply an end-to-end global structured pruning of convolutional layers without using metrics like magnitude and gradient norms, and focus on optimizing the pruned network's PSNR on the validation set. Furthermore, we have experimentally shown that the bias terms take considerable amount of the runtime while increasing PSNR marginally, hence we have also applied bias removal to the convolutional layers. Our method adds ~1dB on Bicubic upscaling PSNR for all tested SR datasets and runs with ~1.17ms on RTX3090 and ~2.9ms on RTX3070, for 720p inputs and 4K outputs, both in FP16 precision. Bicubic++ won NTIRE 2023 RTSR Track 2 x3 SR competition and is the fastest among all competitive methods. Being almost as fast as the standard Bicubic upsampling method, we believe that Bicubic++ can set a new industry standard.



Others or Issues
- Ubuntu 22.04์์ cv.Videowriter X โ ๊ฒฐ๊ณผ๋ฌผ ๋น๋์ค๋ฅผ ๋ณ๋๋ก google drive์ ์ฌ๋ ค์ ํ์ธํจ
Result
Face swap

Super resolution

Summary
- DNN ๊ธฐ๋ฐ ์ผ๊ตด ํฉ์ฑ
- โ ์ถ๊ฐ ๊ฐ๋ฐ ์์ 1): ๋ณ๋ ฌ ์ฒ๋ฆฌ โ ํฉ์ฑ ์๋ ํฅ์
- โ ์ถ๊ฐ ๊ฐ๋ฐ ์์ 2): upscale ๋ชจ๋ ์ถ๊ฐ โ ํฉ์ฑ ๊ฒฐ๊ณผ FHD๋ก super-resolution
Reference
XailientParallel Processing Using Python for Faster Video Processing

Parallel Processing Using Python for Faster Video Processing
How can we speed up video processing? Parallel processing is the answer!
Doodle-KyungchaePython Multiprocessing์ผ๋ก ๋ณ๋ ฌ์ฒ๋ฆฌ, ๋น๋์ค ์ฒ๋ฆฌ๋ก ๋ง๋ณด๊ธฐ
Python Multiprocessing์ผ๋ก ๋ณ๋ ฌ์ฒ๋ฆฌ, ๋น๋์ค ์ฒ๋ฆฌ๋ก ๋ง๋ณด๊ธฐ
Why Multiprocessing? ์ด์ ํฌ์คํธ(๋งํฌ)์์๋ ์ธ๊ธํ๋ฏ์ด, Python์ Global Interpreter Lock(GIL) ๋ก ์ธํด์ ์์น์ ์ผ๋ก๋ c์์์ ๊ฐ์ด fork ๋ฑ ํ๋ก์ธ์ค ๋ถ๊ธฐ๊ฐ ๋งํ์๋ค. Multiprocessing์ ํตํด์ ์ด๋ฐ ํ๊ณ์ ์ ๊ทน๋ณตํ ์ ์๋๋ฐ, ์ด๋ฒ ํฌ์คํธ์์๋ ๊ทธ ์ค Process๋ฅผ ์ด์ฉํ๋ค. SIMD vs Pipeline ๋ด๊ฐ ์ฌ์ฉํ๋ ๋ณ๋ ฌํ ๋ฐฉ์์ ํฌ๊ฒ ๋๊ฐ์ง์ธ๋ฐ, ์ด ์ค Process๋ฅผ ์ด์ฉํ ํ์ดํ๋ผ์ธ ๊ธฐ๋ฐ์ ๋ณ๋ ฌ์ฒ๋ฆฌ๋ ์๋ 2๋ฒ์ ์ค๋ช ๊ณผ ๊ฐ์ด ํ๋ฒ์ ์ฒ๋ฆฌํด์ผํ๋ ๋ฐ์ดํฐ์ ์๋ณด๋ค๋ ํ๋์ ๋ฐ์ดํฐ์ ๋ํด ์ํํด์ผํ๋ ์์ ์์ฒด๊ฐ ๋ณต์กํ๊ณ ์ฌ๋ฌ ๋จ๊ณ๋ก ์ด๋ฃจ์ด์ ธ ์์ ๋ ์ ์ฉํ๋ค. ๋จ์ํ ์์ ์ด ๋งค์ฐ ๋ง์ด ๋ฐ๋ณต๋์ด์ผํ๋ค --> Pool์ ์ฌ์ฉํ๋ SIMD์ค..
Video Upscalers Benchmark
Video Upscalers Benchmark
The most extensive comparison of video super-resolution (VSR) algorithms by subjective quality
- Authors

- Name
- Amelia Young
- GitHub
- @ameliacode