Skip to content

Commit 3ea54e7

Browse files
committed
folder add
1 parent aea2aae commit 3ea54e7

15 files changed

+297
-0
lines changed

add/clear_cache.sh

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
GREEN='\033[0;32m'
4+
RED='\033[0;31m'
5+
WHITE='\033[0;97m'
6+
NC='\033[0m' # No Color
7+
echo -e ""
8+
echo -e "${WHITE}--------------------------------------------------------------------------------------------------${NC}"
9+
echo -e "${RED}!! only proceed if you stopped a running PhotoDB instance !!${NC}"
10+
echo -e "${GREEN}Do you want to remove all database cache files?${NC}"
11+
echo -e "${WHITE}This may be needed after update to a newer PhotoDB Version.${NC}"
12+
echo -e "${WHITE}At next start of PhotoDB the database cache will be regenerated.${NC}"
13+
echo -e "${WHITE}--------------------------------------------------------------------------------------------------${NC}"
14+
select yn in "Yes" "No" "Cancel"; do
15+
case $yn in
16+
Yes ) break;;
17+
No ) exit;;
18+
Cancel ) exit;;
19+
esac
20+
done
21+
22+
unlink label_store.mv.db
23+
unlink label_store.trace.db
24+
unlink label_store.trace.db.old
25+
unlink photo_cache.mv.db
26+
unlink photo_cache.trace.db
27+
unlink photo_cache.trace.db.old
28+
unlink sample_cache.mv.db
29+
unlink sample_cache.trace.db
30+
unlink sample_cache.trace.db.old
31+
unlink thumb_cache.mv.db
32+
unlink thumb_cache.trace.db
33+
unlink sample_cache.trace.db.old
34+
35+
echo -e "${GREEN}Done. Now you may start PhotoDB. It may take some time to regenerate database caches.${NC}"

add/config.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
http_port: 8080
2+
login: false
3+
4+
photo:
5+
projects:
6+
7+
- project: myproject
8+
root_path: 'photo_meta'
9+
root_data_path: 'photo_data'
10+
classification_definition_csv: photo_classification_definitions.csv
11+
review_list_path: 'photo_review_lists'

add/github_update.sh

+173
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
#!/bin/bash
2+
3+
update_folders=(
4+
lib
5+
mustache
6+
webcontent
7+
)
8+
9+
update_files=(
10+
photodb.jar
11+
)
12+
13+
GREEN='\033[0;32m'
14+
RED='\033[0;31m'
15+
WHITE='\033[0;97m'
16+
NC='\033[0m' # No Color
17+
echo -e ""
18+
echo -e "${WHITE}--------------------------------------------------------------------------------------------------${NC}"
19+
echo -e "${RED}!! only proceed if you stopped a running PhotoDB instance !!${NC}"
20+
echo -e "${GREEN}Do you want to download the latest PhotoDB release package, backup changed files and performe update?${NC}"
21+
echo -e "${WHITE}After update it may be needed to run the ./clear_cache.sh script for PhotoDB to work properly.${NC}"
22+
echo -e "${WHITE}--------------------------------------------------------------------------------------------------${NC}"
23+
select yn in "Yes" "No" "Cancel"; do
24+
case $yn in
25+
Yes ) break;;
26+
No ) exit;;
27+
Cancel ) exit;;
28+
esac
29+
done
30+
31+
timestamp=$(date +%Y_%m_%d__%H_%M_%S)
32+
echo $timestamp
33+
34+
echo -e "${GREEN}delete folder 'update'${NC}"
35+
rm -rf ./update
36+
if [ -d ./update ]
37+
then
38+
echo -e "${RED}folder 'update' still exists, abort. (no changes performed)${NC}"
39+
exit 1
40+
fi
41+
42+
echo -e "${GREEN}download latest 'package.zip'${NC}"
43+
wget --directory-prefix=./update https://github.com/Nature40/photodb/releases/latest/download/package.zip
44+
45+
if [ ! -f ./update/package.zip ]
46+
then
47+
echo -e "${RED}could not find 'update/package.zip', abort. (no changes performed)${NC}"
48+
exit 2
49+
fi
50+
51+
echo -e "extract 'package.zip'"
52+
unzip ./update/package.zip -d ./update
53+
echo -e "${GREEN}download update done.${NC}"
54+
55+
for i in "${update_folders[@]}"; do
56+
#echo "$i"
57+
if [ ! -d ./update/$i ]
58+
then
59+
echo -e "${RED}folder '$i' is missing in update, abort. (no changes performed)${NC}"
60+
exit 3
61+
fi
62+
done
63+
64+
for i in "${update_files[@]}"; do
65+
#echo "$i"
66+
if [ ! -f ./update/$i ]
67+
then
68+
echo -e "${RED}file '$i' is missing in update, abort. (no changes performed)${NC}"
69+
exit 4
70+
fi
71+
done
72+
73+
if [ ! -d ./backup ]
74+
then
75+
mkdir ./backup
76+
fi
77+
78+
if [ ! -d ./backup ]
79+
then
80+
echo -e "${RED}could not create 'backup' folder, abort. (no changes performed)${NC}"
81+
exit 5
82+
fi
83+
84+
backup=./backup/$timestamp
85+
86+
if [ -d $backup ]
87+
then
88+
echo -e "${RED}backup folder '$backup' already exists, abort. (no changes performed)${NC}"
89+
exit 6
90+
fi
91+
92+
mkdir $backup
93+
if [ ! -d $backup ]
94+
then
95+
echo -e "${RED}could not create backup folder '$backup', abort. (no changes performed)${NC}"
96+
exit 7
97+
fi
98+
99+
for i in "${update_folders[@]}"; do
100+
#echo "$i"
101+
if [ -d ./$i ]
102+
then
103+
mv ./$i $backup
104+
else
105+
echo -e "missing folder for backup '$i'. continue."
106+
fi
107+
done
108+
109+
for i in "${update_files[@]}"; do
110+
#echo "$i"
111+
if [ -f ./$i ]
112+
then
113+
mv ./$i $backup
114+
else
115+
echo -e "missing file for backup '$i'. continue."
116+
fi
117+
done
118+
119+
for i in "${update_folders[@]}"; do
120+
#echo "$i"
121+
if [ -d ./$i ]
122+
then
123+
echo -e "${RED}folder '$i' still exists after backup, abort. (some folders/files may be moved to backup already)${NC}"
124+
exit 8
125+
fi
126+
done
127+
128+
for i in "${update_files[@]}"; do
129+
#echo "$i"
130+
if [ -f ./$i ]
131+
then
132+
echo -e "${RED}file '$i' still exists after backup, abort. (some folders/files may be moved to backup already)${NC}"
133+
exit 9
134+
fi
135+
done
136+
echo -e "${GREEN}backup done. ('$backup')${NC}"
137+
138+
for i in "${update_folders[@]}"; do
139+
#echo "$i"
140+
mv ./update/$i ./
141+
done
142+
143+
for i in "${update_files[@]}"; do
144+
#echo "$i"
145+
mv ./update/$i ./
146+
done
147+
148+
for i in "${update_folders[@]}"; do
149+
#echo "$i"
150+
if [ -d ./$i ]
151+
then
152+
echo -e "updated folder: ${WHITE}$i${NC}"
153+
else
154+
echo -e "${RED}folder '$i' has not beend updated (missing), abort. (some updates may have been performed, your should revert to a backup))${NC}"
155+
exit 10
156+
fi
157+
done
158+
159+
for i in "${update_files[@]}"; do
160+
#echo "$i"
161+
if [ -f ./$i ]
162+
then
163+
echo -e "updated file: ${WHITE}$i${NC}"
164+
else
165+
echo -e "${RED}file '$i' has not beend updated (missing), abort. (some updates may have been performed, your should revert to a backup))${NC}"
166+
exit 11
167+
fi
168+
done
169+
echo -e ""
170+
echo -e "${GREEN}update done. backup in '$backup'${NC}"
171+
echo -e ""
172+
exit 0
173+

add/lib/3rdparty_license.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
This software contains unmodified binary redistributions for
2+
H2 database engine (https://h2database.com/),
3+
which is dual licensed and available under the MPL 2.0
4+
(Mozilla Public License) or under the EPL 1.0 (Eclipse Public License).
5+
An original copy of the license agreement can be found at:
6+
https://h2database.com/html/license.html
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#comment
2+
name,description
3+
incorrect box, Box does not mark (correctly) an object.
4+
person, Photo will be locked. (DSGVO)
5+
animal, unspecified animal
6+
Kleintier, unbestimmt
7+
Großtier, unbestimmt
8+
Katze, generisch
9+
Hauskatze, Felis catus
10+
Wildkatze, Felis silvestris silvestris
11+
Hirsch, generisch
12+
Wildschwein, Sus scrofa
13+
Waschbär, Procyon lotor
592 Bytes
Loading
532 Bytes
Loading
539 Bytes
Loading
567 Bytes
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
PhotoSens: v1.0
2+
file: photo1_20220101_010101.jpg
3+
log:
4+
- {action: create yaml, date: '2022-02-22T17:03:23'}
5+
- {action: generate jpg metadata, date: '2022-02-22T17:03:46'}
6+
location: photo_data
7+
date: '2022-01-01T01:01:01'
8+
width: 33
9+
height: 28
10+
detections:
11+
- bbox: [0.42424244, 0.4642857, 0.18181819, 0.25]
12+
classifications:
13+
- {classification: Hauskatze, classificator: Expert, identity: anonymous, date: '2022-02-28T11:28:46'}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
PhotoSens: v1.0
2+
file: photo2_20220101_020101.jpg
3+
log:
4+
- {action: create yaml, date: '2022-02-22T17:03:23'}
5+
- {action: generate jpg metadata, date: '2022-02-22T17:03:46'}
6+
location: photo_data
7+
date: '2022-01-01T02:01:01'
8+
width: 40
9+
height: 30
10+
detections:
11+
- bbox: [0.525, 0.46666667, 0.175, 0.3]
12+
classifications:
13+
- {classification: Wildschwein, classificator: Expert, identity: anonymous, date: '2022-02-28T11:28:58'}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
PhotoSens: v1.0
2+
file: photo3_20220101_030101.jpg
3+
log:
4+
- {action: create yaml, date: '2022-02-22T17:03:23'}
5+
- {action: generate jpg metadata, date: '2022-02-22T17:03:47'}
6+
location: photo_data
7+
date: '2022-01-01T03:01:01'
8+
width: 36
9+
height: 19
10+
detections:
11+
- bbox: [0.44444445, 0.10526316, 0.2777778, 0.42105263]
12+
classifications:
13+
- {classification: Waschbär, classificator: Expert, identity: anonymous, date: '2022-02-28T11:29:06'}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
PhotoSens: v1.0
2+
file: photo4_20220101_040101.jpg
3+
log:
4+
- {action: create yaml, date: '2022-02-22T17:03:23'}
5+
- {action: generate jpg metadata, date: '2022-02-22T17:03:47'}
6+
location: photo_data
7+
date: '2022-01-01T04:01:01'
8+
width: 35
9+
height: 26
10+
detections:
11+
- bbox: [0.37142858, 0.115384616, 0.2, 0.34615386]
12+
classifications:
13+
- {classification: Hirsch, classificator: Expert, identity: anonymous, date: '2022-02-28T11:29:19'}
14+
- bbox: [0.4857143, 0.5769231, 0.22857143, 0.30769232]
15+
classifications:
16+
- {classification: Wildkatze, classificator: Expert, identity: anonymous, date: '2022-02-28T11:29:41'}

add/photodb.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
exec java -Djava.awt.headless=true -XX:-UsePerfData -Djava.io.tmpdir=/var/tmp -Xmx2g -classpath 'photodb.jar:lib/*' photodb.Terminal "$@"

add/win_photodb.cmd

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
java -Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl -Djava.awt.headless=true -XX:-UsePerfData -Xmx3g -classpath photodb.jar;lib/* photodb.Terminal %*
2+
3+
pause

0 commit comments

Comments
 (0)