rrmina / fast-neural-style-pytorch

Fast Neural Style Transfer implementation in PyTorch :art: :art: :art:
317 stars 77 forks source link

webcam.py: can't adjust resolution? #7

Closed HandsomeDevilv112 closed 5 years ago

HandsomeDevilv112 commented 5 years ago

I'm on ubuntu 18.04 and using "droidcam" so I can use my phone as a webcam.

running "python webcam.py" Produces this error: Traceback (most recent call last): File "webcam.py", line 4, in import utils File "/home/al/fast-neural-style-pytorch/utils.py", line 121 tuple_with_path = (*original_tuple, path) ^ SyntaxError: invalid syntax

However, I'm able to work around this by using "python3". What really has me confused is that I seem unable to adjust the window size/resolution. I've tried editing the two lines in webcam.py, and I've tried adding the command line options, but I always seem to wind up at 640x480. Furthermore, I can change which style_transform_path in webcam.py. Which only makes this weirder.

Any guidance would be greatly appreciated.

rrmina commented 5 years ago

This might help you https://answers.opencv.org/question/139138/how-to-resize-frames-from-video-with-aspect-ratio/

HandsomeDevilv112 commented 5 years ago

Thank you, that put me in the right direction. Looks like the problem is a driver issue between my phone/droidcam and the code. I'll go ahead and close the issue, figuring it will be just fine when I buy a real camera with real drivers.

HandsomeDevilv112 commented 4 years ago

Just to follow up on this, I was right. I've been able to adjust resolution after purchasing a proper webcam.