AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.71k stars 7.96k forks source link

Yolov4 on MacBook Pro 16-inch using GPU = AMD Radeon Pro 5500M 8 GB #7261

Open KohlerVG opened 3 years ago

KohlerVG commented 3 years ago

Hello, I am wanting to learn how to use Yolov4 with my MacBook Pro 16-inch using my GPU = AMD Radeon Pro 5500M 8 GB, but I do not see any way to do that from my understanding, could you help me figure out how to do this please? Thanks! Kohler

versavel commented 3 years ago

You will need an Nvidia GPU or use OpenCV+CPU-only. Maybe Bootcamp/Windows and an Nvidia eGPU ???

stephanecharette commented 3 years ago

Darknet works fine in CPU mode on a Mac without any special GPU. You won't be able to train without a GPU (see: https://www.ccoderun.ca/programming/darknet_faq/#train_with_cpu) but it should be fine for single image inference.

KohlerVG commented 3 years ago

Thanks for the quick feedback! my point in using Yolov4 is to use a webcam and live-stream Yolov4 for real-time feedback. If you know of anything that could help me achieve this that would be awesome!

cenit commented 3 years ago

we can discuss (open an RFC issue) about expanding coverage of alternative architectures, so that Darknet runs also on AMD GPUs, or better on manycore architectures. We can expand OpenMP to cover accelerators, or we can discuss OpenCL, SYCL,, C++AMP, or anything else you might propose.

KohlerVG commented 3 years ago

Wow cenit! Now you're talking my language, I would love to use my Mac AMD GPU, I've looked into OpenCL which seems to be standard issue for mac users, I want to get the most power out of my Mac, my goal is to use a camera to get live-feed and have it display on my computer using both my CPU and GPU, if I need to open this topic in another forum, could you point me in the right direction? Thanks! Kohler

cenit commented 3 years ago

We just opened discussions also here on github (you might see a new tab on top). Of course, we would need help to develop that. I saw some ports of Darknet to OpenCL in the past, we could start from that and update the old codebase to the new requirements... but of course we need help to do that

KohlerVG commented 3 years ago

So where do I start?

AlexeyAB commented 3 years ago

For Detection (inference) maybe its better to make converter from Darknet model to Pytorch/ONNX/TFLite/TensoRT model and use this model on any device: Smartphone (TF-Mobile), MacBook (Onnx-runtime), Jetson (TensorRT), SmartCamera (OpenVINO for OpenCV-AI-Kit / Intel MyriadX, TFLite for Google Coral TPU edge, ...) ... the inference even much faster than on Darknet: https://github.com/AlexeyAB/darknet/issues/7179

Currently you can find converters there: https://github.com/AlexeyAB/darknet#yolo-v4-in-other-frameworks

It works much more efficiently than the port on OpenCL.

KohlerVG commented 3 years ago

Thanks for all the info AlexeyAB! I'm new to this, can you tell me which of the ones you suggested to start working on that will work on my GPU = AMD Radeon Pro 5500M 8 GB

versavel commented 3 years ago

"MacBook (Onnx-runtime)"

For training models (and inference), you could use GPUs in the cloud (AWS, Google, Azure). If you google "train darknet on colab” you will find several write-ups and videos to get you started.

KohlerVG commented 3 years ago

Is this what you're talking about versavel? ONNX homepage link = https://www.onnxruntime.ai/