|
#!/bin/bash |
|
|
|
|
|
|
|
|
|
|
|
cd home/ubuntu |
|
if [ ! -d yolor ]; then |
|
echo "Running first-time script." |
|
git clone -b main https://github.com/WongKinYiu/yolov7 && sudo chmod -R 777 yolov7 |
|
cd yolov7 |
|
bash data/scripts/get_coco.sh && echo "Data done." & |
|
sudo docker pull nvcr.io/nvidia/pytorch:21.08-py3 && echo "Docker done." & |
|
python -m pip install --upgrade pip && pip install -r requirements.txt && python detect.py && echo "Requirements done." & |
|
wait && echo "All tasks done." |
|
else |
|
echo "Running re-start script." |
|
i=0 |
|
list=$(sudo docker ps -qa) |
|
while IFS= read -r id; do |
|
((i++)) |
|
echo "restarting container $i: $id" |
|
sudo docker start $id |
|
|
|
sudo docker exec -d $id python utils/aws/resume.py |
|
done <<<"$list" |
|
fi |
|
|