Skip to content
Snippets Groups Projects
Commit 4a5b0b71 authored by Anton Tetov Johansson's avatar Anton Tetov Johansson
Browse files

new Makefile to clone submodule and make darknet with LIBSO=1

parent db056587
No related branches found
No related tags found
No related merge requests found
Makefile 0 → 100644
.DEFAULT_GOAL := default
LIBSO=1
export LIBSO
darknet:
git submodule init
git submodule update
default: darknet
$(MAKE) -C darknet
.PHONY: default
...@@ -9,7 +9,7 @@ Darknet is a deep learning framework created by the author of YOLO. It is writte ...@@ -9,7 +9,7 @@ Darknet is a deep learning framework created by the author of YOLO. It is writte
### Detector Training ### Detector Training
Check the [instruction](https://github.com/AlexeyAB/darknet#how-to-train-to-detect-your-custom-objects) for how to train the YOLO detector. Check the [instruction](https://github.com/AlexeyAB/darknet#how-to-train-to-detect-your-custom-objects) for how to train the YOLO detector.
## Camera Calibartion ## Camera Calibration
Think YOLO as a black box, it consumes photos that contains objects or not and outputs objects' positions in the pixel coordinate. However, we want to know their positions on the planting bed, namely global coordinate. That is why we need camera calibration. This step was done seperately on MATLAB and offered us the intrinsic matrix of the camera. You **do not need to redo** this unless you want to change to a new model of camera. Check MATLAB [instruction](https://ww2.mathworks.cn/help/vision/ug/using-the-single-camera-calibrator-app.html;jsessionid=1a474c11e3e6063620885c4ae708) for how to use the camera calibration app. Think YOLO as a black box, it consumes photos that contains objects or not and outputs objects' positions in the pixel coordinate. However, we want to know their positions on the planting bed, namely global coordinate. That is why we need camera calibration. This step was done seperately on MATLAB and offered us the intrinsic matrix of the camera. You **do not need to redo** this unless you want to change to a new model of camera. Check MATLAB [instruction](https://ww2.mathworks.cn/help/vision/ug/using-the-single-camera-calibrator-app.html;jsessionid=1a474c11e3e6063620885c4ae708) for how to use the camera calibration app.
**Note**: The result have to be transferred to `struct`, a MATLAB data type, before saving. **Note**: The result have to be transferred to `struct`, a MATLAB data type, before saving.
...@@ -33,19 +33,16 @@ $$ ...@@ -33,19 +33,16 @@ $$
$$ $$
## Install, Compile ## Install, Compile
1. `git clone *link* --recurse-submodules` this repo along with the submodule, Darknet; 1. `git clone git@gitlab.control.lth.se:alexp/farmbot`
2. Go to the path of the submodule `cd ./darknet`; 2. `make` to download darknet and compile
3. 3. `conda create --name farm --file requirements.txt`, this will install all required python packages. Change the enviroment name to whatever you like.
3. Change Makefile;
4. Compile Darknet;
5. Go back to the main path and `conda create --name <env> --file requirements.txt`, this will install all relied python packages. Change the enviroment name to whatever you like.
**Note**: I assume conda, a package management software, has been installed before. **Note**: I assume conda, a package management software, has been installed before.
### Compile Darknet ### Compile Darknet
Check the [instruction](https://github.com/AlexeyAB/darknet#how-to-compile-on-linux-using-make) for how to use `Make` to compile on Linux. Check the [instruction](https://github.com/AlexeyAB/darknet#how-to-compile-on-linux-using-make) for how to use `Make` to compile on Linux.
**Note**: Change `LIBSO=1` in Makefile. This will ensure libdarknet.so be generated, which will be used in darknet.py. In the top Makefile `LIBSO=1` is set before the Makefile in darknet is run. This will ensure libdarknet.so be generated, which will be used in darknet.py.
## Before starting the system ## Before starting the system
**Always calibrate the position before using!** **Always calibrate the position before using!**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment