This project utilizes computer vision and artificial intelligence to automate the counting of shrimp in an aquarium using a Jetson Nano. The system captures images from a camera placed infront of the aquarium, processes them using deep learning models, and provides the count for automation purposes.
- Installation
- Usage
- Hardware Requirements
- Software Requirements
- Code Structure
- Configuration
- Integration with Aquarium Automation
- Demo
- Train
- License
# Clone the repository
git clone https://github.com/EbonGit/Aquarium-Shrimp-Counting-System-YOLO.git
# Navigate to the project directory
cd Aquarium-Shrimp-Counting-System-YOLO.git
# Install dependencies
pip install -r requirements.txt
# Install Pycuda
export PATH=/usr/local/cuda-10.2/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64:$LD_LIBRARY_PATH
python3 -m pip install pycuda --user
# Install Seaborn
sudo apt install python3-seaborn
# Run the shrimp counting system
python app.py
# Run the arduino ino script on arduino UNO
const int segmentPins[] = {2, 3, 4, 5, 6, 7, 8}; // Digital pins for segments
//b a f c g d e
- NVIDIA Jetson Nano 4GB
- Arduino UNO R1
- Logitech C270
Explain the organization of your codebase. Highlight key directories and files.
/BreadcrumbsAquarium-Shrimp-Counting-System-YOLO
├── model.pt
├── arduino
│ ├── shrimp.ino
├── yolov5
│ ├── images
│ ├── build
│ │ ├── model.engine
│ │ └── ...
├── app.py
├── README.md
├── requirements.txt
└── ...
serial:
port: /dev/ttyUSB0
engine:
path: yolov5/build/model.engine
WIDTH:
resolution: 600x600
model:
type: YOLOv5
void loop() {
if(Serial.available()){
receceivedBytes = Serial.read();
receceivedChar = receceivedBytes - '0';
}
for (int i = 0; i < numSegments; i++) {
digitalWrite(segmentPins[i], bitRead(seg[receceivedChar][0], i));
}
}
To use this system for automation with an Arduino UNO, simply take the input value from the serial communication and use it, for example, to feed the shrimp accordingly and monitor the population's evolution over time.
To train your own model, you can follow the example from the yolov5 or yolov8 notebook and then use TensorRT to convert the .pt model to .engine, making it ready for use. (Link)
# Generate .wts file from .pt
python gen_wts.py -w model.pt -o model.wts
# Generate .engine file from .wts
./yolov5_det -s model.wts model.engine s
This project is licensed under the MIT License.