HypoX64 / DeepMosaics

Automatically remove the mosaics in images and videos, or add mosaics to them.
GNU General Public License v3.0
2.14k stars 441 forks source link

exiting due to unkown error #70

Closed calvin360 closed 3 years ago

calvin360 commented 3 years ago

deep mosiac exits early when rebuilding the video when using google colab. The video being processed has been cut using the windows photo app which might be an issue. The input command is !python3 deepmosaic.py --media_path="/content/DeepMosaics/imgs/MIDD-817(1a).mp4" --model_path="/content/DeepMosaics/pretrained_models/clean_youknow_video.pth" --mode="clean" --no_preview --gpu_id=0 --fps 0 -ss 00:00:00 -t 00:00:00 --mask_threshold 64 and the output is attached below.

makedir: ./result segment parameters: 12.4M netG parameters: 26.65M Step:1/4 -- Convert video to images Clean temp... ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04) configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared libavutil 55. 78.100 / 55. 78.100 libavcodec 57.107.100 / 57.107.100 libavformat 57. 83.100 / 57. 83.100 libavdevice 57. 10.100 / 57. 10.100 libavfilter 6.107.100 / 6.107.100 libavresample 3. 7. 0 / 3. 7. 0 libswscale 4. 8.100 / 4. 8.100 libswresample 2. 9.100 / 2. 9.100 libpostproc 54. 7.100 / 54. 7.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/content/DeepMosaics/imgs/MIDD-817(1a).mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: mp41isom creation_time : 2020-02-12T18:31:23.000000Z Duration: 00:29:00.67, start: 0.000000, bitrate: 3902 kb/s Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 3707 kb/s, 30 fps, 30 tbr, 30k tbn, 60 tbc (default) Metadata: creation_time : 2021-07-27T15:07:05.000000Z handler_name : VideoHandler encoder : AVC Coding Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default) Metadata: creation_time : 2021-07-27T15:07:05.000000Z handler_name : SoundHandler Stream mapping: Stream #0:1 -> #0:0 (aac (native) -> mp3 (libmp3lame)) Press [q] to stop, [?] for help -async is forwarded to lavfi similarly to -af aresample=async=1:min_hard_comp=0.100000:first_pts=0. Output #0, mp3, to './tmp/DeepMosaics_temp/voice_tmp.mp3': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: mp41isom TSSE : Lavf57.83.100 Stream #0:0(und): Audio: mp3 (libmp3lame), 48000 Hz, stereo, fltp, 320 kb/s (default) Metadata: creation_time : 2021-07-27T15:07:05.000000Z handler_name : SoundHandler encoder : Lavc57.107.100 libmp3lame [aac @ 0x560c0eb5f900] decode_band_types: Input buffer exhausted before END element found Error while decoding stream #0:1: Invalid data found when processing input size= 67997kB time=00:29:00.67 bitrate= 320.0kbits/s speed=41.7x
video:0kB audio:67996kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.001577% ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04) configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared libavutil 55. 78.100 / 55. 78.100 libavcodec 57.107.100 / 57.107.100 libavformat 57. 83.100 / 57. 83.100 libavdevice 57. 10.100 / 57. 10.100 libavfilter 6.107.100 / 6.107.100 libavresample 3. 7. 0 / 3. 7. 0 libswscale 4. 8.100 / 4. 8.100 libswresample 2. 9.100 / 2. 9.100 libpostproc 54. 7.100 / 54. 7.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/content/DeepMosaics/imgs/MIDD-817(1a).mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: mp41isom creation_time : 2020-02-12T18:31:23.000000Z Duration: 00:29:00.67, start: 0.000000, bitrate: 3902 kb/s Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 3707 kb/s, 30 fps, 30 tbr, 30k tbn, 60 tbc (default) Metadata: creation_time : 2021-07-27T15:07:05.000000Z handler_name : VideoHandler encoder : AVC Coding Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default) Metadata: creation_time : 2021-07-27T15:07:05.000000Z handler_name : SoundHandler Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native)) Press [q] to stop, [?] for help [swscaler @ 0x55a76142c000] deprecated pixel format used, make sure you did set range correctly Output #0, image2, to './tmp/DeepMosaicstemp/video2image/output%06d.jpg': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: mp41isom encoder : Lavf57.83.100 Stream #0:0(und): Video: mjpeg, yuvj420p(pc), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc (default) Metadata: creation_time : 2021-07-27T15:07:05.000000Z handler_name : VideoHandler encoder : Lavc57.107.100 mjpeg Side data: cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1 frame=52220 fps= 52 q=0.0 Lsize=N/A time=00:29:00.66 bitrate=N/A speed=1.73x
video:5994909kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown Step:2/4 -- Find mosaic location 52220/52220 [###################################] 100.00% 00:35:41/00:35:41 Optimize mosaic locations... Step:3/4 -- Clean Mosaic: 52220/52220 [###################################] 100.00% 01:22:43/01:22:43 Step:4/4 -- Convert images to video Traceback (most recent call last): File "/usr/lib/python3.7/multiprocessing/queues.py", line 242, in _feed send_bytes(obj) File "/usr/lib/python3.7/multiprocessing/connection.py", line 200, in send_bytes self._send_bytes(m[offset:offset + size]) File "/usr/lib/python3.7/multiprocessing/connection.py", line 397, in _send_bytes self._send(header) File "/usr/lib/python3.7/multiprocessing/connection.py", line 368, in _send n = write(self._handle, buf) BrokenPipeError: [Errno 32] Broken pipe Traceback (most recent call last): File "/usr/lib/python3.7/multiprocessing/queues.py", line 242, in _feed send_bytes(obj) File "/usr/lib/python3.7/multiprocessing/connection.py", line 200, in send_bytes self._send_bytes(m[offset:offset + size]) File "/usr/lib/python3.7/multiprocessing/connection.py", line 397, in _send_bytes self._send(header) File "/usr/lib/python3.7/multiprocessing/connection.py", line 368, in _send n = write(self._handle, buf) BrokenPipeError: [Errno 32] Broken pipe Traceback (most recent call last): File "/usr/lib/python3.7/multiprocessing/queues.py", line 242, in _feed send_bytes(obj) File "/usr/lib/python3.7/multiprocessing/connection.py", line 200, in send_bytes self._send_bytes(m[offset:offset + size]) File "/usr/lib/python3.7/multiprocessing/connection.py", line 397, in _send_bytes self._send(header) File "/usr/lib/python3.7/multiprocessing/connection.py", line 368, in _send n = write(self._handle, buf) BrokenPipeError: [Errno 32] Broken pipe Traceback (most recent call last): File "/usr/lib/python3.7/multiprocessing/queues.py", line 242, in _feed send_bytes(obj) File "/usr/lib/python3.7/multiprocessing/connection.py", line 200, in send_bytes self._send_bytes(m[offset:offset + size]) File "/usr/lib/python3.7/multiprocessing/connection.py", line 397, in _send_bytes self._send(header) File "/usr/lib/python3.7/multiprocessing/connection.py", line 368, in _send n = write(self._handle, buf) BrokenPipeError: [Errno 32] Broken pipe Exception in thread Thread-52222: Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/content/DeepMosaics/cores/clean.py", line 183, in write_result save_ori,imagepath,img_origin,img_fake,x,y,size = write_pool.get() File "/usr/lib/python3.7/multiprocessing/queues.py", line 94, in get res = self._recv_bytes() File "/usr/lib/python3.7/multiprocessing/connection.py", line 212, in recv_bytes self._check_closed() File "/usr/lib/python3.7/multiprocessing/connection.py", line 136, in _check_closed raise OSError("handle is closed") OSError: handle is closed

ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04) configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared libavutil 55. 78.100 / 55. 78.100 libavcodec 57.107.100 / 57.107.100 libavformat 57. 83.100 / 57. 83.100 libavdevice 57. 10.100 / 57. 10.100 libavfilter 6.107.100 / 6.107.100 libavresample 3. 7. 0 / 3. 7. 0 libswscale 4. 8.100 / 4. 8.100 libswresample 2. 9.100 / 2. 9.100 libpostproc 54. 7.100 / 54. 7.100 [mjpeg @ 0x55bac588ca00] EOI missing, emulating Input #0, image2, from './tmp/DeepMosaics_temp/replacemosaic/output%06d.jpg': Duration: 00:34:48.64, start: 0.000000, bitrate: N/A Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc Stream mapping: Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264)) Press [q] to stop, [?] for help [libx264 @ 0x55bac588de00] using SAR=1/1 [libx264 @ 0x55bac588de00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 [libx264 @ 0x55bac588de00] profile High, level 4.0 [libx264 @ 0x55bac588de00] 264 - core 152 r2854 e9a5903 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, mp4, to './tmp/DeepMosaics_temp/video_tmp.mp4': Metadata: encoder : Lavf57.83.100 Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuvj420p(pc), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 30 fps, 15360 tbn, 30 tbc Metadata: encoder : Lavc57.107.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1 frame=52216 fps=6.8 q=-1.0 Lsize= 953084kB time=00:29:00.43 bitrate=4486.0kbits/s speed=0.228x
video:952465kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.064936% [libx264 @ 0x55bac588de00] frame I:272 Avg QP:19.24 size: 58788 [libx264 @ 0x55bac588de00] frame P:13709 Avg QP:22.37 size: 33376 [libx264 @ 0x55bac588de00] frame B:38235 Avg QP:24.08 size: 13124 [libx264 @ 0x55bac588de00] consecutive B-frames: 1.8% 0.5% 3.4% 94.3% [libx264 @ 0x55bac588de00] mb I I16..4: 31.2% 64.6% 4.2% [libx264 @ 0x55bac588de00] mb P I16..4: 19.8% 31.7% 0.7% P16..4: 27.7% 7.5% 1.8% 0.0% 0.0% skip:10.9% [libx264 @ 0x55bac588de00] mb B I16..4: 4.3% 6.8% 0.1% B16..8: 40.9% 4.0% 0.3% direct: 2.0% skip:41.6% L0:55.9% L1:41.1% BI: 3.0% [libx264 @ 0x55bac588de00] 8x8 transform intra:60.8% inter:90.6% [libx264 @ 0x55bac588de00] coded y,uvDC,uvAC intra: 30.0% 61.4% 4.8% inter: 8.4% 19.9% 0.2% [libx264 @ 0x55bac588de00] i16 v,h,dc,p: 29% 26% 15% 30% [libx264 @ 0x55bac588de00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 24% 31% 2% 2% 2% 2% 2% 2% [libx264 @ 0x55bac588de00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 20% 13% 3% 8% 8% 6% 4% 2% [libx264 @ 0x55bac588de00] i8c dc,h,v,p: 42% 25% 27% 5% [libx264 @ 0x55bac588de00] Weighted P-Frames: Y:0.8% UV:0.7% [libx264 @ 0x55bac588de00] ref P L0: 68.0% 8.8% 17.5% 5.7% 0.0% [libx264 @ 0x55bac588de00] ref B L0: 90.9% 7.4% 1.6% [libx264 @ 0x55bac588de00] ref B L1: 96.0% 4.0% [libx264 @ 0x55bac588de00] kb/s:4482.87 sh: 1: Syntax error: "(" unexpected Clean temp... Finished!

calvin360 commented 3 years ago

@HypoX64 i'm not sure if you intended this, but adding brackets to the file name will cause the conversion to fail