-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrain-files-camera.sh
44 lines (34 loc) · 1.15 KB
/
train-files-camera.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
#This script collects pictures from the Raspberry Pi camera and puts them into folders for NN training
echo "Welcome to the training tool for Consumabot"
echo "This script is released under GPL 3.0 license"
echo "Please select your desired action:"
echo "----------------------------------"
echo "1 - Train bot for new items"
echo "2 - Sync with training server"
echo "3 - Train models and sync back"
echo "What's your choice?"
read choice
if [ "$choice" == "1" ]
then
echo "How long do we want to train? (in seconds)"
read length
echo "How long should we wait between two pictures?"
read interval
echo "We currently have trained the model on the following categories:"
echo "-------------"
ls -dl ~/train/*/
echo "On what element do we want to train (please be exact with the description)"
read prefix
sudo mkdir -p ~/train/$prefix
sudo chmod -v 777 ~/train/$prefix
echo "Starting on $prefix"
sleep 1
longms=$(($length*1000))
intervalms=$(($interval*1000))
raspistill -t $longms -tl $intervalms -o ~/train/$prefix/%d.jpg -v -awb auto -sh 100
sleep 10
else
echo "Synchronizing training folders"
rsync -avz -e 'ssh' ~/train/ [email protected]:~/train/
fi