Runs yolov10 with Python and connects to the DLang with the socket module and passes the data to the D program.
from ultralytics import YOLOv10
import supervision as sv
import cv2
import socket
import pickle
pip install supervision
pip install ultralytics
pip install opencv-python
import std.stdio;
import std.socket;
import std.array;
1. Download any yolov10 pt from the link below and put it in the same folder as your project folder.
https://github.com/THU-MIG/yolov10
3. Then copy the name of the pt you downloaded and paste it to 'YOUR YOLOV10 PT' part of python code.
MODEL_PATH = 'YOUR YOLOV10 PT'
3. Make sure you have any D compiler like dmd.
4. Open your D command prompt and cd to your project path.
5. Run the python code first then run the D code with "dub run" command in your D command prompt.
dub run
6. If everything goes right you should have seen the output.
This error occurs when you try to make a memory allocation in the D language and there is not enough memory available.. Ensure that your camera is turned on and yolov10 is running.