www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Centroid tracking using DCV

reply Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
I heard you are not having fun enough with d today.

Do you know you can do things like this with dlang now? After 
some fiddling with it, my last commits made this possible.

how it looks like: https://www.youtube.com/watch?v=ACC_-TDAtqc
source code: 
https://github.com/aferust/oclcv/tree/main/examples/centroidtracking
DCV: https://github.com/libmir/dcv

Sorry for the potato-quality video. My art director is on 
vacation.

I am cheating a little with OpenCL since things are not fast 
enough at the moment.

Hope you like it.

Enjoy!
Feb 15 2023
next sibling parent Andrea Fontana <nospam example.org> writes:
On Wednesday, 15 February 2023 at 17:32:33 UTC, Ferhat Kurtulmuş 
wrote:
 I heard you are not having fun enough with d today.

 Do you know you can do things like this with dlang now? After 
 some fiddling with it, my last commits made this possible.

 how it looks like: https://www.youtube.com/watch?v=ACC_-TDAtqc
 source code: 
 https://github.com/aferust/oclcv/tree/main/examples/centroidtracking
 DCV: https://github.com/libmir/dcv

 Sorry for the potato-quality video. My art director is on 
 vacation.

 I am cheating a little with OpenCL since things are not fast 
 enough at the moment.

 Hope you like it.

 Enjoy!
Nice!
Feb 16 2023
prev sibling next sibling parent ryuukk_ <ryuukk.dev gmail.com> writes:
That's pretty cool, thanks for sharing!
Feb 17 2023
prev sibling next sibling parent Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
On Wednesday, 15 February 2023 at 17:32:33 UTC, Ferhat Kurtulmuş 
wrote:
 I heard you are not having fun enough with d today.

 Do you know you can do things like this with dlang now? After 
 some fiddling with it, my last commits made this possible.

 how it looks like: https://www.youtube.com/watch?v=ACC_-TDAtqc
 source code: 
 https://github.com/aferust/oclcv/tree/main/examples/centroidtracking
 DCV: https://github.com/libmir/dcv

 Sorry for the potato-quality video. My art director is on 
 vacation.

 I am cheating a little with OpenCL since things are not fast 
 enough at the moment.

 Hope you like it.

 Enjoy!
Hello everyone, I was looking for ways to run pre-trained DCNN models (inference) using D. I then ran across onnxruntime, which has a c API. Luckily, it has a bindbc binding readily available. Nowadays, to run inference routines of CNN models, we only need some basic image processing to satisfy the input shape requirements of those models. We have mir.ndslice and dcv, and then we should be able to run, for instance, tinyYOLOv3 with video streams. I believe that such applications will attract more people's attention to d. Here is how it looks like and the source code: https://www.youtube.com/watch?v=m3ex9lDELfQ https://github.com/aferust/dcv-tinyyolov3
Feb 28 2023
prev sibling next sibling parent reply Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
On Wednesday, 15 February 2023 at 17:32:33 UTC, Ferhat Kurtulmuş 
wrote:
 I heard you are not having fun enough with d today.
Hello everyone, I was looking for ways to run pre-trained DCNN models (inference) using D. I then ran across onnxruntime, which has a c API. Luckily, it has a bindbc binding readily available. Nowadays, to run inference routines of CNN models, we only need some basic image processing to satisfy the input shape requirements of those models. We have mir.ndslice and dcv, and then we should be able to run, for instance, tinyYOLOv3 with video streams. I believe that such applications will attract more people's attention to d. Here is how it looks like and the source code: https://www.youtube.com/watch?v=m3ex9lDELfQ https://github.com/aferust/dcv-tinyyolov3
Feb 28 2023
parent reply Sergey <kornburn yandex.ru> writes:
On Tuesday, 28 February 2023 at 12:08:14 UTC, Ferhat Kurtulmuş 
wrote:
 On Wednesday, 15 February 2023 at 17:32:33 UTC, Ferhat 
 Kurtulmuş wrote:
 I heard you are not having fun enough with d today.
Hello everyone, We have mir.ndslice and dcv, and then we should be able to run, for instance, tinyYOLOv3 with video streams. I believe that such applications will attract more people's attention to d. Here is how it looks like and the source code: https://www.youtube.com/watch?v=m3ex9lDELfQ https://github.com/aferust/dcv-tinyyolov3
Great job. Could we have any comparison in the performance/memory usage versus original solution in Python?
Feb 28 2023
parent Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
On Tuesday, 28 February 2023 at 12:29:05 UTC, Sergey wrote:
 On Tuesday, 28 February 2023 at 12:08:14 UTC, Ferhat Kurtulmuş 
 wrote:
 On Wednesday, 15 February 2023 at 17:32:33 UTC, Ferhat 
 Kurtulmuş wrote:
 I heard you are not having fun enough with d today.
Hello everyone, We have mir.ndslice and dcv, and then we should be able to run, for instance, tinyYOLOv3 with video streams. I believe that such applications will attract more people's attention to d. Here is how it looks like and the source code: https://www.youtube.com/watch?v=m3ex9lDELfQ https://github.com/aferust/dcv-tinyyolov3
Great job. Could we have any comparison in the performance/memory usage versus original solution in Python?
I have not conducted any comparisons yet. There are a lot of factors affecting performance. My old laptop lacks good cuda support, so I disabled the CUDA acceleration. I cannot give you a strongly backed test result, but I can say that preprocessing is not so costly in my example. The FPS drop is primarily due to onnxruntime itself. The preprocessing step only takes 2 or 3 msecs. The newer versions of onnxruntime have various backend options for acceleration, such as CUDA, tensorrt, directML (uses directX).
Feb 28 2023
prev sibling next sibling parent reply Ki Rill <rill.ki yahoo.com> writes:
On Wednesday, 15 February 2023 at 17:32:33 UTC, Ferhat Kurtulmuş 
wrote:
 I heard you are not having fun enough with d today.

 Do you know you can do things like this with dlang now? After 
 some fiddling with it, my last commits made this possible.

 how it looks like: https://www.youtube.com/watch?v=ACC_-TDAtqc
 source code: 
 https://github.com/aferust/oclcv/tree/main/examples/centroidtracking
 DCV: https://github.com/libmir/dcv

 Sorry for the potato-quality video. My art director is on 
 vacation.

 I am cheating a little with OpenCL since things are not fast 
 enough at the moment.

 Hope you like it.

 Enjoy!
I am facing strange ffmpeg errors on Windows. It fails to read a frame. Do you have any ideas how to solve it? Here is the error: ``` ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers built with gcc 12.2.0 (Rev10, Built by MSYS2 project) configuration: --prefix=/mingw64 --target-os=mingw32 --arch=x86_64 --cc=gcc --cxx=g++ --disable-debug --disable-stripping --disable-doc --enable-dxva2 --enable-d3d11va --enable-fontconfig --enable-frei0r --enable-gmp --enable-gnutls --enable-gpl --enable-iconv --enable-libaom --enable-libass --enable-libbluray --enable-libcaca --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libplacebo --enable-librsvg --enable-librtmp --enable-libssh --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libxvid --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libzimg --enable-openal --enable-pic --enable-postproc --enable-runtime-cpudetect --enable-swresample --enable-version3 --enable-vulkan --enable-zlib --enable-librav1e --enable-libsvtav1 --enable-libmfx --enable-amf --enable-nvenc --logfile=config.log --enable-shared libavutil 58. 2.100 / 58. 2.100 libavcodec 60. 3.100 / 60. 3.100 libavformat 60. 3.100 / 60. 3.100 libavdevice 60. 1.100 / 60. 1.100 libavfilter 9. 3.100 / 9. 3.100 libswscale 7. 1.100 / 7. 1.100 libswresample 4. 10.100 / 4. 10.100 libpostproc 57. 1.100 / 57. 1.100 Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf59.27.100 Duration: 00:01:00.01, start: 0.000000, bitrate: 833 kb/s yuv420p(tv, bt709, progressive), 640x480 [SAR 4:3 DAR 16:9], 822 kb/s, 30 fps, 30 tbr, 15360 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] 48000 Hz, stereo, fltp, 2 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0] Using auto hwaccel type dxva2 with new default device. Stream mapping: Press [q] to stop, [?] for help configure renderer for GL-31 Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf60.3.100 rgb24(pc, gbr/bt709/bt709, progressive), 640x480 [SAR 4:3 DAR 16:9], q=2-31, 147456 kb/s, 20 fps, 20 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] encoder : Lavc60.3.100 rawvideo av_interleaved_write_frame(): Broken pipe time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A Broken pipe frame= 1 fps=0.5 q=-0.0 Lsize= 0kB time=00:00:00.50 bitrate= 0.0kbits/s dup=0 drop=3 speed=0.231x video:900kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown Error Program exited with code -1073741819 Conversion failed! ``` Also, it does not work on MacOS as well due to `glfw-d` not supporting it. I will try to replace the gui part with Raylib... Do you have any better solutions?
Jun 22 2023
parent Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
On Friday, 23 June 2023 at 02:16:49 UTC, Ki Rill wrote:
 On Wednesday, 15 February 2023 at 17:32:33 UTC, Ferhat 
 Kurtulmuş wrote:
 [...]
I am facing strange ffmpeg errors on Windows. It fails to read a frame. Do you have any ideas how to solve it? [...]
I am typing those via my phone, and cannot test any code soon. İf you are using pipe processes with ffmpeg executable, the terminal output can be a mix of outputs of ffmpeg and your main process. This makes difficult to search for errors. I think since your main process is interrupted due to an error (maybe an opencl error), ffmpeg stops too. Please note that the centroid tracking example does not use ffmpeg-d (you can modify the code to use it though). For Mac you should use bindbc-glfw by deleting the subconf: "subConfigurations": { "dcv:plot": "use-glfw-d" You can also try using equivalent DCV functions instead of opencl to eliminate opencl errors.
Jun 23 2023
prev sibling parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On Wednesday, 15 February 2023 at 17:32:33 UTC, Ferhat Kurtulmuş 
wrote:
 I heard you are not having fun enough with d today.

 Do you know you can do things like this with dlang now? After 
 some fiddling with it, my last commits made this possible.
Cool stuff! I once contributed Randomized Hough transform to DCV.
 how it looks like: https://www.youtube.com/watch?v=ACC_-TDAtqc
 source code: 
 https://github.com/aferust/oclcv/tree/main/examples/centroidtracking
 DCV: https://github.com/libmir/dcv

 Sorry for the potato-quality video. My art director is on 
 vacation.

 I am cheating a little with OpenCL since things are not fast 
 enough at the moment.

 Hope you like it.

 Enjoy!
Jun 22 2023
parent reply Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
On Friday, 23 June 2023 at 05:07:26 UTC, Dmitry Olshansky wrote:
 On Wednesday, 15 February 2023 at 17:32:33 UTC, Ferhat 
 Kurtulmuş wrote:
 I heard you are not having fun enough with d today.

 Do you know you can do things like this with dlang now? After 
 some fiddling with it, my last commits made this possible.
Cool stuff! I once contributed Randomized Hough transform to DCV.
 how it looks like: https://www.youtube.com/watch?v=ACC_-TDAtqc
 source code: 
 https://github.com/aferust/oclcv/tree/main/examples/centroidtracking
 DCV: https://github.com/libmir/dcv

 Sorry for the potato-quality video. My art director is on 
 vacation.

 I am cheating a little with OpenCL since things are not fast 
 enough at the moment.

 Hope you like it.

 Enjoy!
Hello Dmitry, Can you please take a look at the RHT test code? And please review my modifications on your code due to API changes over time. The circles are not detected in the RHT example at the moment. Maybe I broke something while doing things nog. https://github.com/libmir/dcv/blob/master/examples/rht/source/app.d https://github.com/libmir/dcv/blob/master/source/dcv/features/rht.d
Jun 23 2023
parent Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On Friday, 23 June 2023 at 07:26:03 UTC, Ferhat Kurtulmuş wrote:
 On Friday, 23 June 2023 at 05:07:26 UTC, Dmitry Olshansky wrote:
 On Wednesday, 15 February 2023 at 17:32:33 UTC, Ferhat 
 Kurtulmuş wrote:
 [...]
Cool stuff! I once contributed Randomized Hough transform to DCV.
 [...]
Hello Dmitry, Can you please take a look at the RHT test code? And please review my modifications on your code due to API changes over time. The circles are not detected in the RHT example at the moment. Maybe I broke something while doing things nog.
I’m on vacation but I’ll take a look.
 https://github.com/libmir/dcv/blob/master/examples/rht/source/app.d


 https://github.com/libmir/dcv/blob/master/source/dcv/features/rht.d
Jun 23 2023