YOLOv8 Aerial Sheep Detection and Counting. Simulated on Gazebo.
This repository contains a Sheep Detector and Counter trained by YOLOv8 algorithm with Sheep Dataset from Roboflow.
Train results on YOLOv8n. Weights are provided in resources/weights direcotry.
# create
python -m venv yolov8-sheep
# activate
source yolov8-sheep/bin/activate
git clone https://github.com/monemati/YOLOv8-Sheep-Detection-Counting.git
cd YOLOv8-Sheep-Detection-Counting
pip install -e '.[dev]'
# On image
python count.py
# On Video
python track.py
- Change file_path to your desired files. Sample files are provided in resources/images and resources/videos direcotries.
- You need to follow this tutorial to setup test environment.
- You can use Models and Worlds provided in resources/models and resources/worlds direcotries.
- Open a terminal and use the command below to launch your world (this will launch gazebo):
roslaunch gazebo_ros agriculture.launch
- Open a new terminal and run a UAV:
cd ~/ardupilot/Tools/autotest && ./sim_vehicle.py -v ArduCopter -f gazebo-iris -I0
- After seeing "APM: EKF2 IMU0 is using GPS" message in console, you can use the commands below to takeoff:
mode guided
arm throttle
takeoff 40
- Now in a new terminal use the command below:
python sheep.py
- You can watch the demo from this file