Open-source weed detection library

Hello,

In case it’s of use to AgOpenGPS platforms - I’ve just released an open-source library (openweedlocator-tools) to support weed detection. Installable via pip install openweedlocator-tools[desktop] or pip install openweedlocator-tools[rpi]. It supports ‘GreenOnBrown’ (i.e. colour based detection) and ‘GreenOnGreen’ (desktop only currently) for in-crop weed detection with YOLO models.

Github repository is available here.

Fairly easy to get started on it, you can just run some of the visualisation examples using your webcam/connected camera, images or videos with the methods below:

from owl.viz import webcam, images_and_video

# Run using your webcam
webcam(algorithm='gog', model_path='models/yolov8n.pt') # press escape to exit, add your own model path as required or clone this repository

# or 
images_and_video(media_path='path/to/your/media_files')

There’s also a code-free Streamlit app you can try on your own images and videos to get a feel for the functionality and/or tune your own models.

Still working on adding support to run any cameras (including picamera or picamera2) so we can more easily use Global Shutter and Arducams with the Pi 5. Will be shifting the OpenWeedLocator (OWL) over to this package as well.

Let me know if you run into any issues.

4 Likes

Could this be used with 2 cameras (to detect 2 rows together) and the results filtered/averaged for toolsteer? :open_mouth:

2 Likes

I’m not too familiar with toolsteer but you could detect green rows using the same GreenOnBrown green detection algorithms. Would just need to tinker with the output a little so you get a centre line.

I think current Pi 4 would struggle with two cameras but the new Pi 5 seems capable of it. What’s the benefit of using two cameras if you can detect two rows with one?

I’d say redundancy + all the factory tools seem to use 2 cameras for some reason.

I think it could be simply 2 separate PI + camera and let windows centrally calculate the offset needed and thus shift the tool.

Not all tool steering developers use two cameras, from what I know, as vision system developer, only Claas based video camera system which include 3D depth option to steer in bigger crops.

Is there any chance of anyone working on tool steer with owl? I was thinking the same here with agopen and hoeing with hydraulic hitch and a camera system that doesn’t cost $35,000 US dollars!

I have been to Agrotechnica and have seen lots of hoeing equipment using camera guidance. But indeed very expencive. So I thought building one myself. But it is not that easy, for me maybe impossible. I will follow this topic!