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

new dir setup for imgs and logs

parent 13c55aa0
No related branches found
No related tags found
No related merge requests found
......@@ -144,3 +144,8 @@ cython_debug/
# custom
creds.py
creds.json
tmp/*
!tmp/.gitkeep
*.log
log/*
!log/.gitkeep
......@@ -9,4 +9,8 @@ darknet:
default: darknet
$(MAKE) LIBSO=$(LIBSO) -C darknet
.PHONY: default darknet
clean:
rm -rf ./tmp/*
rm ./log/*.log
.PHONY: default darknet clean
......@@ -86,6 +86,7 @@ will ensure libdarknet.so be generated, which will be used in darknet.py.
## Before starting the system
**Always calibrate the position before using!**
The purpose is to reset the zero positions of x, y, z axis. This step should be
done manually first and then use the webapp, i.e., the user should push the
grantry and z axis to the upper right corner. Check the [official
......@@ -94,6 +95,11 @@ for how to use the web app to set zeros.
## How to run this system?
There is a main entrypoint, callable using `python -m farmbot_yolo` for a
complete workflow. By running it, you can make Farmbot automatically conduct the
whole process. The three modules can also be run separately, mostly for
debugging purpose.
The software has three main modules:
1. `move`: drive FarmBot to move, take photos, and open/close the gripper
......@@ -101,32 +107,38 @@ The software has three main modules:
bounding boxes
3. `location`: input bounding boxes, transfer to real-world coordinate
We also provide `main.py` as a wrapper for all the modules above. By running it,
you can make Farmbot automatically conduct the whole process. The three modules
can also be run separately, mostly for debugging purpose.
First go to `farmbot_yolo` and `conda activate <env>` to run the following scripts.
`<env>` is the same as the one you created in _Install, Compile_
`<env>` is the same as the one you created in [Setup](#setup)
### Move Farmbot, take photos, and open/close the gripper
TODO: Add the arguments.
```bash
python -m farmbot_yolo ...
```
### YOLO detection
All the arguments for file path are set to default.
```
python farmbot_yolo.detect --dont_show --ext_output --save_labels --input ../img --weights ../weights/yolov3-vattenhallen_best.weights --config_file ../cfg/yolov3-vattenhallen-test.cfg --data_file ../data/vattenhallen.data
python -m farmbot_yolo.detect --ext_output --save_labels --input ../img --weights ../weights/yolov3-vattenhallen_best.weights --config_file ../cfg/yolov3-vattenhallen-test.cfg --data_file ../data/vattenhallen.data
```
### Calculate location
```
python farmbot_yolo.location -v -cam ../static/camera_no_distortion.mat -loc ../img/locations/ -a ../img/annotations -o ../static/distance.txt -l ../log/location.log
python -m farmbot_yolo.location -v -cam ../static/camera_no_distortion.mat -loc ../img/locations/ -a ../img/annotations -o ../static/distance.txt -l ../log/location.log
```
All the arguments has default values, which means they can be all omitted if you
don't change the document tree structure.
### Scan the bed and pick
### Download pictures
重新生成 requirement!!
Pictures that are taken using the web ui or from the code can be downloaded using:
```bash
python -m farmbot_yolo.download
```
......@@ -14,7 +14,7 @@ authors = [
classifiers = [
"Programming Language :: Python :: 3",
]
requires-python = ">=3.8"
requires-python = ">=3.7"
dependencies = [
"requests",
"numpy",
......
from pathlib import Path
HERE = Path(__file__).parent
REPO = HERE.parent
REPO = HERE.parent.parent
TMPDIR = REPO / "tmp"
LOGDIR = REPO / "log"
CREDS_PATH = REPO / "creds.json"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment