tfaehse / DashcamCleaner

Censor identifiable information in videos, in particular dashcam recordings in Germany.
GNU Affero General Public License v3.0
130 stars 27 forks source link

errors #69

Closed Dave04O4 closed 1 year ago

Dave04O4 commented 1 year ago

I've tested it with Python version 8 - 10 and always get the same error.

(P2) d:\Dashcam\D2>python main.py Traceback (most recent call last): File "d:\Dashcam\D2\main.py", line 261, in window = MainWindow() File "d:\Dashcam\D2\main.py", line 37, in init self.blur_wrapper = self.setup_blurrer() File "d:\Dashcam\D2\main.py", line 58, in setup_blurrer blur_wrapper = qtVideoBlurWrapper(weights_name, init_params) File "d:\Dashcam\D2\src\qt_wrapper.py", line 28, in init QThread.init(self) TypeError: VideoBlurrer.init() missing 2 required positional arguments: 'weights_name' and 'parameters'

joshinils commented 1 year ago

sry, can not reproduce, on my linux/ubuntu it prints the following when starting the gui;

Using CPU.
Worker created

and then sits idle, your output suggests something else may be wrong? what settings did you use? which file did you use?

ps. tfaehse und ich sind deutsche

Dave04O4 commented 1 year ago

Gut zu Wissen, Danke.

Ich habe danach auch festgestellt, dass Cuda noch nicht aktiviert ist und auch nicht aktiviert bekomme. Eventuell liegt es daran. Ich habe gestern auch erst meine RTX 4080 eingebaut.

Ich habe die aktuelle YOLOv8 Version verwendet.

Ich werde die Tage mal eine Vorgängerversion testen und dann mal schauen, ob es damit läuft.

Mit meinem Ryzen 7 7700X lief es, mit der Vorgängerversion, glaube da war es noch YOLOv5.

Dave04O4 commented 1 year ago

Ich habe es jetzt mit der Version vom 22.01.2023 getestet und die lief eigentlich mal mit meiner RTX 2080(alter PC). Die lief auch später noch mit meinem neuen PC und wo ich den Ryzen 7 7700X getestet habe.

Ich hatte dann Windows Neuinstalliert und jetzt kriege ich es nicht mit CPU oder GPU zum laufen. Ich habe jetzt auch nur mit Python 3.10.10 und einmal mit Pyhton 3.8 getestet. Jetzt habe ich mit Dashcam Cleaner Version vom 22.08.2022, 22.01.2023 und der aktuellen Version getestet.

Wahrscheinlich ist auch in irgendein Modul ein Bug drinne, weil der Fehler ist bei jeder Version gerade bei mir gleich.

Es ist auch egal welche requirements.txt oder requirements_gpu.txt verwende, es ist der gleiche Fehler.

Ich werde es irgendwann noch Mal testen.

joshinils commented 1 year ago

@tfaehse: Vielleicht sollten man drüber nachdenken mittels logging die settings, etc. zu loggen, damit man darum beten kann diese mitzuliefern. Auch mit Infos zu OS, CPU/GPU, Python Version und wenns geht installierter Python Module und deren Version sowie yolo-version. Auch die Version des geklonten Codes, also das commit-hash wäre sehr nützlich zum Prüfen, ob jemand die aktuelle oder welche Version verwendet hat. Sonst ist das wie bisher immer ein rechtes Rätselraten, was passiert ist und warum.

joshinils commented 1 year ago

Wahrscheinlich ist auch in irgendein Modul ein Bug drinne, weil der Fehler ist bei jeder Version gerade bei mir gleich.

Das mit der requirements.txt ist auch doof, ich hab davon keine Ahnung, und eigentlich sollte das besser sein, mit mindest-versionsnummern, bzw. fixen Nummern, damit das immer geht. (ping #38)

steffenWi commented 1 year ago

Hi, I'm on a Linux distribution and I'm receiving the same error message. I followed the conda based installation guide.

My GPU is an AMD RX GPU if that matters.

steffenWi commented 1 year ago

After dabbling around with it for a while I got it running by swapping the src/qtVideoBlurWrapper.py's order of inheritance.

Previous: class qtVideoBlurWrapper(QThread, VideoBlurrer):

Now: class qtVideoBlurWrapper(VideoBlurrer, QThread):

I don't know why that works.

Dave04O4 commented 1 year ago

After dabbling around with it for a while I got it running by swapping the src/qtVideoBlurWrapper.py's order of inheritance.

Previous: class qtVideoBlurWrapper(QThread, VideoBlurrer):

Now: class qtVideoBlurWrapper(VideoBlurrer, QThread):

I don't know why that works.

Thank You.

Jetzt startet es und jetzt das nächste Problem.

(P2) d:\Dashcam\D1>python main.py Using NVIDIA GeForce RTX 4080. Worker created Blurrer started! D:\Dashcam\Anaconda\envs\P2\lib\site-packages\imageio\plugins\pillow.py:101: UserWarning: Can't determine file format to write as. You _must_ setformatduring write or the call will fail. Useextension` to supress this warning. warnings.warn(

0: 1088x1920 (no detections), 1: 1088x1920 (no detections), 2: 1088x1920 (no detections), 3: 1088x1920 (no detections), 4: 1088x1920 (no detections), 5: 1088x1920 (no detections), 6: 1088x1920 (no detections), 7: 1088x1920 (no detections), 8: 1088x1920 (no detections), 9: 1088x1920 (no detections), 10: 1088x1920 (no detections), 11: 1088x1920 (no detections), 12: 1088x1920 (no detections), 13: 1088x1920 (no detections), 14: 1088x1920 (no detections), 15: 1088x1920 (no detections), 430.1ms Speed: 4.1ms preprocess, 26.9ms inference, 0.2ms postprocess per image at shape (1, 3, 1920, 1920) TypeError: print_exception(): Exception expected for value, str found

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "d:\Dashcam\D1\main.py", line 206, in blur_wrapper_finished msg_box.setText("Blurring resulted in errors.") File "d:\Dashcam\D1\src\qt_wrapper.py", line 94, in run writer.append_data(frame_blurred_rgb) File "D:\Dashcam\Anaconda\envs\P2\lib\site-packages\imageio\v2.py", line 215, in append_data return self.instance.write(im, *self.write_args) File "D:\Dashcam\Anaconda\envs\P2\lib\site-packages\imageio\plugins\pillow.py", line 354, in write raise TypeError( TypeError: The keyword fps is no longer supported. Use duration(in ms) instead, e.g. fps=50 == duration=20 (1000 1/50).`

tfaehse commented 1 year ago

Hi! That seems to be a non-backwards compatible update by Pillow, you can downgrade it to 9.3.0 for now. I will push a fix later today that addresses this.

Huh, I stand corrected. @Dave04O4 kannst du mir mal deine installierten Packages schicken? Kann man mit "conda list" / "pip list" ausgeben lassen.

andremotz commented 1 year ago

Hi tfaehse, ich kann das Problem auf drei Maschinen replizieren, ua. mit folgenden Setups:

Ubuntu 22.04 LTS VM, Python 3.10, pip: imageio>=2.9.0 imageio-ffmpeg>=0.4.5 ipython>=8.4.0 matplotlib>=3.2.2 more_itertools>=8.7.0 numpy>=1.18.5 omegaconf>=2.3.0 opencv-python>=4.1.2 pandas>=1.2.3 Pillow==9.3.0 psutil>=5.9.1 pyside6>=6.2.2.1 PyYAML>=5.3.1 requests>=2.25.1 scipy>=1.4.1 seaborn>=0.11.1 tensorboard>=2.4.1 torch>=2.0 torchaudio>=0.8.1 torchvision>=0.8.1 tqdm>=4.41.0 ultralytics>=8.0.59

MacPro, macOS 12.6.5 Python 3.11, pip

MacBook Pro, macOS 13.4, Conda, Python 3.8 Gleiche Abhängigkeiten: imageio>=2.9.0 imageio-ffmpeg>=0.4.5 ipython>=8.4.0 matplotlib>=3.2.2 more_itertools>=8.7.0 numpy>=1.18.5 omegaconf>=2.3.0 opencv-python>=4.1.2 pandas>=1.2.3 Pillow psutil>=5.9.1 pyside6>=6.2.2.1 PyYAML>=5.3.1 requests>=2.25.1 scipy>=1.4.1 seaborn>=0.11.1 tensorboard>=2.4.1 torch>=2.0 torchaudio>=0.8.1 torchvision>=0.8.1 tqdm>=4.41.0 ultralytics>=8.0.59

Dave04O4 commented 1 year ago

Hi! That seems to be a non-backwards compatible update by Pillow, you can downgrade it to 9.3.0 for now. I will push a fix later today that addresses this.

Huh, I stand corrected. @Dave04O4 kannst du mir mal deine installierten Packages schicken? Kann man mit "conda list" / "pip list" ausgeben lassen.

Hat jetzt leider ein bisschen gedauert.

`Package Version


absl-py 1.4.0 antlr4-python3-runtime 4.9.3 asttokens 2.2.1 backcall 0.2.0 cachetools 5.3.1 certifi 2023.5.7 charset-normalizer 3.1.0 colorama 0.4.6 contourpy 1.0.7 cycler 0.11.0 decorator 5.1.1 executing 1.2.0 filelock 3.12.0 fonttools 4.39.4 google-auth 2.19.0 google-auth-oauthlib 1.0.0 grpcio 1.54.2 idna 3.4 imageio 2.29.0 imageio-ffmpeg 0.4.8 ipython 8.13.2 jedi 0.18.2 Jinja2 3.1.2 kiwisolver 1.4.4 Markdown 3.4.3 MarkupSafe 2.1.2 matplotlib 3.7.1 matplotlib-inline 0.1.6 more-itertools 9.1.0 mpmath 1.3.0 networkx 3.1 numpy 1.24.3 oauthlib 3.2.2 omegaconf 2.3.0 opencv-python 4.7.0.72 packaging 23.1 pandas 2.0.1 parso 0.8.3 pickleshare 0.7.5 Pillow 9.3.0 pip 23.0.1 prompt-toolkit 3.0.38 protobuf 4.23.2 psutil 5.9.5 pure-eval 0.2.2 pyasn1 0.5.0 pyasn1-modules 0.3.0 Pygments 2.15.1 pyparsing 3.0.9 PySide6 6.5.1 PySide6-Addons 6.5.1 PySide6-Essentials 6.5.1 python-dateutil 2.8.2 pytz 2023.3 PyYAML 6.0 requests 2.31.0 requests-oauthlib 1.3.1 rsa 4.9 scipy 1.10.1 seaborn 0.12.2 sentry-sdk 1.24.0 setuptools 66.0.0 shiboken6 6.5.1 six 1.16.0 stack-data 0.6.2 sympy 1.12 tensorboard 2.13.0 tensorboard-data-server 0.7.0 torch 2.0.1 torchaudio 2.0.2 torchvision 0.15.2 tqdm 4.65.0 traitlets 5.9.0 typing_extensions 4.6.2 tzdata 2023.3 ultralytics 8.0.109 urllib3 1.26.16 wcwidth 0.2.6 Werkzeug 2.3.4 wheel 0.38.4`

retr0virus commented 1 year ago

For me the swapping of the two parameters as steffenWi suggested also works (the UI didn't start without the swap) on an updated Manjaro system.

But it seems to take forever... are there any hardware speedups that can be enabled? My GPU idles on 0% while most of my CPU cores are at over 98%. A 3 minute video, already taking more than 2 1/2 hours and still only half the way rendered (unfortunately I didn't record the exact starting time).

steffenWi commented 1 year ago

@retr0virus the low speed indicates that it's using your CPU instead of your GPU to perform the calculations. If you launch the cli.py with some valid parameters one of the first lines it writes to the console is either "Using CPU" or "Using GPU".

Dave04O4 commented 1 year ago

Hallo,

mit der neusten Version geht es jetzt.

Vielen Dank.

Einzige ich kriege die GPU nicht dafür aktiviert.