hezhangsprinter / ID-CGAN

Image De-raining Using a Conditional Generative Adversarial Network
http://www.rci.rutgers.edu/~vmp93/index_ImageDeRaining.html
249 stars 57 forks source link

Whether or not the code can process real time videos using opencv #7

Closed TrinhQuocNguyen closed 6 years ago

TrinhQuocNguyen commented 6 years ago

Hello Hezhangsprinter, Thank you for your hard work. I have been played around with your code, and did some modify to process sequence images (image by image) using opencv, but when I try to process a real time video which is captured from camera, it seems to me that the process is slow. And after investigating, I have found that the code of converting the RGB <-> BGR consumes a lot of time. Do you have any ideas to improve it? Thank you.

hezhangsprinter commented 6 years ago

Hi, I suggest you remove the rgb to bgr if it make hard for real time processing. It wont influence too much on the results if you retrain using rgb samples

On Dec 27, 2017 7:39 PM, "Trinh Saiki" notifications@github.com wrote:

Hello Hezhangsprinter, Thank you for your hard work. I have been played around with your code, and did some modify to process sequence images (image by image) using opencv, but when I try to process a real time video which is captured from camera, it seems to me that the process is slow. And after investigating, I have found that the code of converting the RGB <-> BGR consumes a lot of time. Do you have any ideas to improve it? Thank you.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hezhangsprinter/ID-CGAN/issues/7, or mute the thread https://github.com/notifications/unsubscribe-auth/AXFwlwCr53u_nuCsOMbt8QHYKGVUQ2Nyks5tEuM4gaJpZM4RN6Ty .

TrinhQuocNguyen commented 6 years ago

Thank you for your reply, actually I have just figured out that the main reason is to reconstruct the image from the output of the model consumes most, but we can not do anything with it but reduce the size of the image.

The second cause is casting into floatTensor from byteTenSor as function: input = input:float(), and it costs 0.033 seconds to do so. Do you have any ideals to reduce the time casting to floatTensor? Thank you

On Thu, Dec 28, 2017 at 10:26 He Zhang notifications@github.com wrote:

Hi, I suggest you remove the rgb to bgr if it make hard for real time processing. It wont influence too much on the results if you retrain using rgb samples

On Dec 27, 2017 7:39 PM, "Trinh Saiki" notifications@github.com wrote:

Hello Hezhangsprinter, Thank you for your hard work. I have been played around with your code, and did some modify to process sequence images (image by image) using opencv, but when I try to process a real time video which is captured from camera, it seems to me that the process is slow. And after investigating, I have found that the code of converting the RGB <-> BGR consumes a lot of time. Do you have any ideas to improve it? Thank you.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hezhangsprinter/ID-CGAN/issues/7, or mute the thread < https://github.com/notifications/unsubscribe-auth/AXFwlwCr53u_nuCsOMbt8QHYKGVUQ2Nyks5tEuM4gaJpZM4RN6Ty

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hezhangsprinter/ID-CGAN/issues/7#issuecomment-354210399, or mute the thread https://github.com/notifications/unsubscribe-auth/ASkHs-ZRgCKA0TfbtXKRN2cQ1_bHR2I5ks5tEu45gaJpZM4RN6Ty .

-- Best regards,

Nguyễn Quốc Trình Email : nguyenquoctrinhctt3@gmail.com Skype : nguyenquoctrinhctt3 Phone : +84 166 8834 380

TrinhQuocNguyen commented 6 years ago

Hi, After investigating carefully I have found that because we compute in the size of image in every layer, it takes a lot of time to do so. I have tried to reduce the number of filter banks and size of image, then I can do real time. Thank you again. I'll close the issues now.