Skip to content

Commit

Permalink
Merge pull request #4 from hackffm/activate202309
Browse files Browse the repository at this point in the history
Activate202309
  • Loading branch information
vkuehn authored Sep 14, 2023
2 parents 9e79122 + bd75eb0 commit 5da070e
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 21 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
# actioncam

some python code arround opencv to use a webcam for action detection
some python code arround opencv to use a webcam for action and object detection

## Objects

Aruco Code is supported

## currently implemented features
- show video in a simple webfrontend

## planned features
- recording
- recording if action of objects tracked by opencv
- recording of short actions scenes
- compress recordings
- mail compressed files
- simple webfrontend

## setup

potentially only running on a debian based installation

for that use
actioncam/shell/0_setup_os.sh
actioncam/shell/2_setup_folders.sh

## documentation

Expand Down
41 changes: 28 additions & 13 deletions shell/setup/2_setup_folders.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,48 @@
#!/bin/bash
# all files should be in plac by dockerfile
echo "check setup"
if [ ! -d ~/actioncam ]; then
echo "create actioncam folders"
mkdir ~/actioncam
mkdir ~/actioncam/data
mkdir ~/actioncam/compressed
mkdir ~/actioncam/log
mkdir ~/actioncam/recordings
mkdir ~/actioncam/send
mkdir ~/actioncam
mkdir ~/actioncam/data
mkdir ~/actioncam/compressed
mkdir ~/actioncam/log
mkdir ~/actioncam/recordings
mkdir ~/actioncam/send
fi
#
cd ~/actioncam
if [ ! -f ~/actioncam/config.json ]; then
echo "copy config"
cp config.json ~/actioncam
echo "copy config"
cp ./config.json ~/actioncam/
fi
if [ -f ~/actioncam/config.json ]; then
echo "found config.json and preparing for current user"
sed -i -e 's/HOME/'"${HOME}"'/g' ~/actioncam/config.json
echo "found config.json and preparing for current user"
sed -i -e 's/piuser/'"${USERNAME}"'/g' ~/actioncam/config.json
fi
#
if [ ! -f ~/actioncam/config.json ]; then
echo "copy config"
cp ./config.json ~/actioncam/
fi
if [ ! -f ~/actioncam/requirements.txt ]; then
echo "copy requierements.txt"
cp ./requirements.txt ~/actioncam/
fi
if [ ! -d ~/actioncam/venv ]; then
mkdir ~/actioncam/venv
echo "create python venv"
python3 -m venv ~/actioncam/venv

echo #install python packages"
source ~/actioncam/venv/bin/activate
cd ~/actioncam
pip install --upgrade pip
pip install -r requirements.txt
pip install -r ~/actioncam/requirements.txt
fi
if [ ! -f ~/actioncam/code ]; then
echo "copy code"
cp -r ../../code ~/actioncam/
fi
if [ ! -f ~/actioncam/start_actioncam.sh ]; then
echo "copy start_actioncam.sh"
cp ../startup/start_actioncam.sh ~/actioncam/
fi
11 changes: 10 additions & 1 deletion shell/setup/Dockerfile_actioncam
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,22 @@ FROM python:3
ARG ACTIONCAM_DIR=/home/camuser/actioncam
ARG USERNAME=camuser

ENV ACTIONCAM_DIR=${ACTIONCAM_DIR}
ENV USERNAME=${USERNAME}

COPY ./shell/setup/0_setup_os.sh .
RUN bash -c ./0_setup_os.sh
RUN apt update && apt install -y vim

RUN useradd -ms /bin/bash $USERNAME

RUN mkdir $ACTIONCAM_DIR
RUN mkdir $ACTIONCAM_DIR/data
RUN mkdir $ACTIONCAM_DIR/compressed
RUN mkdir $ACTIONCAM_DIR/log
RUN mkdir $ACTIONCAM_DIR/recordings
RUN mkdir $ACTIONCAM_DIR/send

COPY ./code $ACTIONCAM_DIR/code
COPY ./shell/setup/2_setup_folders.sh $ACTIONCAM_DIR
COPY ./shell/startup/start_actioncam.sh $ACTIONCAM_DIR
Expand All @@ -26,5 +36,4 @@ RUN bash -c $ACTIONCAM_DIR/2_setup_folders.sh

EXPOSE 8080
WORKDIR $ACTIONCAM_DIR
ENV ACTIONCAM_DIR=${ACTIONCAM_DIR}
CMD ${ACTIONCAM_DIR}/start_actioncam.sh
10 changes: 5 additions & 5 deletions shell/setup/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
"picamera": 99
},
"DEFAULT": {
"folder_data": "HOME/actioncam/data",
"folder_data": "/home/piuser/actioncam/data",
"identify": "1",
"location": "default",
"log_file": "actioncam.log",
"log_location": "HOME/actioncam/log",
"log_location": "/home/piuser/actioncam/log",
"mode": "stop",
"name": "actioncam",
"output": "avi",
"recording_location": "HOME/actioncam/recordings",
"recording_location": "/home/piuser/actioncam/recordings",
"state_file": "state.json"
},
"camera": {
Expand Down Expand Up @@ -56,7 +56,7 @@
},
"compress": {
"active": false,
"compress_location": "HOME/actioncam/compressed",
"compress_location": "/home/piuser/actioncam/compressed",
"log_file": "compress.log",
"remove_compressed": false
},
Expand Down Expand Up @@ -92,7 +92,7 @@
"send": {
"active": true,
"log_file": "send.log",
"send_location": "HOME/actioncam/send",
"send_location": "/home/piuser/actioncam/send",
"targets": ["mail","upload"]
},
"upload": {
Expand Down

0 comments on commit 5da070e

Please sign in to comment.