k4yt3x / video2x

A machine learning-based lossless video super resolution framework. Est. Hack the Valley II, 2018.
https://video2x.org
GNU Affero General Public License v3.0
10.71k stars 1k forks source link

Add Multithreading #15

Closed wuast94 closed 6 years ago

wuast94 commented 6 years ago

Based on #11,

Enhance the overall performance with multithreading.

~~1. try to make waifu2x going to make multible pictures at once and not one by one. https://github.com/K4YT3X/video2x/issues/11#issuecomment-431707841~~

~~1. Add a feature for adding folder within multiple files. https://github.com/K4YT3X/video2x/issues/11#issuecomment-431706764~~

k4yt3x commented 6 years ago

Hello @wuast94, thanks for opening a new issue. I already have the new version with multithreading ready last night. However, due to the GitHub outage (at least at my area), I wasn't able to interact with GitHub.

I have edited your issue, and here are the changes:

  1. try to make waifu2x going to make multible pictures at once and not one by one. https://github.com/K4YT3X/video2x/issues/11#issuecomment-431707841

This statement is misleading. video2x is already telling waifu2x to process an entire folder of images at once. Unless there's something else that you mean, this has already been resolved in #11.

  1. Add a feature for adding folder within multiple files. https://github.com/K4YT3X/video2x/issues/11#issuecomment-431706764

This is a good idea, but that's not under the topic of adding mutithreading. Each feature should be in their own issue. Therefore, if you want that enhancement, please go ahead and open up a new issue. Thank you for your participation.

wuast94 commented 6 years ago

i mean that for now waifu2x is going picture by picture and not on multibile pictures at once. for example: when i download 1000 files with 1 connection .. every time a file is ready the download starts new and the connection must established new. when i download with 10 connections it loads much faster.

k4yt3x commented 6 years ago

@wuast94 ok I get you. Yeah that's multithreading. Starting version 2.1.0, video2x will create 5 waifu2x-caffe rendering threads by default. You can already try it out.

wuast94 commented 6 years ago

Small test runs´s godd and i think fast too. bigger test is running now with 8 Threads

wuast94 commented 6 years ago

Just a bit bad formatting but that are the smaller things :) image

Now my Gpu is under 100% Compute in task manager. I think you got it .. good work :)

k4yt3x commented 6 years ago

@wuast94 I am aware of that problem. It's just when you have multiple threads printing on the same screen, the output stream conflicts. I'll add a thread lock like what I did to my konadl project. Should be an easy fix, doesn't even need an issue.

Impressive system you've got there to get 8 threads running. Mine can get barely to 5.

k4yt3x commented 6 years ago

The printing issue should also be fixed by now. I'll test it tonight.

WSADKeysGaming commented 6 years ago

Is the performance effect on multithreading measures? I was thinking of a progress bar added back if the performance was similar before the progress bar and multithreading. On Tue, Oct 23, 2018, 11:41 AM K4YT3X notifications@github.com wrote:

The printing issue should also be fixed by now. I'll test it tonight.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/K4YT3X/video2x/issues/15#issuecomment-432323591, or mute the thread https://github.com/notifications/unsubscribe-auth/Ags0tIUxwQDTleUENLcZI3GbKk0EXWQ6ks5un0aqgaJpZM4XyuVb .

wuast94 commented 6 years ago

I can't test how much threads and performance I can get becouse my cpu is rip and I must ship it to dealer to repair it. But I think I can get more threads running :P

k4yt3x commented 5 years ago

@WSADKeysGaming we had a progress bar before, but that requires each image to be processed separately since waifu2x-caffe only outputs one line at the end no matter how many frames you upscale. However, upscaling each image individually really hurts the performance, as mentioned in #11 .