Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
issue #12 prep smartcam integration
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeslabreche committed Jan 13, 2024
1 parent 4585801 commit 1998204
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ demos/doom-earth.wad
lib/
deploy/
backup/
extract/
extract/
smartcam/config.dev.ini
65 changes: 65 additions & 0 deletions smartcam/config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
[conf]
downlink_log_if_no_images = yes
entry_point_model = default
downlink_thumbnails = yes
downlink_compressed_raws = no
downlink_compressed_split = 10M
raw_compression_type = fapec
collect_metadata = yes
tle_path = /etc/tle
quota_toGround = 100000
max_error_count = 10

[camera]
cam_exposure = 2
cam_gains = [13,7,8]

[gen]
gen_type = aoi
gen_interval_default = 0.5
gen_interval_throttle = 0
gen_number = 3
gen_geojson = aois/continents.json

[img]
raw_keep = no
png_keep = no

[jpeg]
jpeg_scaling = 0.3
jpeg_quality = 90

[compression_fapec]
chunk = 512K
threads = 1
dtype = 16
band = 1
losses = x10
meaningful_bits = 12
lev = 5

[clustering]
cluster = no
cluster_for_labels = ["earth"]
cluster_k = 4
cluster_collect_threshold = 10
cluster_img_types = ["jpeg","png","ims_rgb","fapec"]

[model_default]
default.tflite_model = models/default/model.tflite
default.labels = models/default/labels.txt
default.labels_keep = ["earth:doom","edge:doom","bad"]
default.input_height = 224
default.input_width = 224
default.input_mean = 0
default.input_std = 255
default.confidence_threshold = 0.70

[model_doom]
doom.bin_model = /home/georges/dev/opssat-doom/smartcam/start.sh
doom.labels = /home/georges/dev/opssat-doom/smartcam/labels.txt
doom.labels_keep = ["doom"]
doom.input_format = jpeg
doom.write_mode = /home/georges/dev/opssat-doom/demos/doom.wad
doom.args =
doom.confidence_threshold = 1
1 change: 1 addition & 0 deletions smartcam/labels.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
doom
46 changes: 46 additions & 0 deletions smartcam/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/sh

# function to show usage
show_usage() {
echo "Usage: $0 -i <image_filepath> -w <wad_filepath>"
}

# check if the number of arguments is correct
if [ "$#" -ne 4 ]; then
show_usage
exit 1
fi

# parsing arguments
while getopts ":i:w:" opt; do
case $opt in
i) image_file="$OPTARG"
;;
w) wad_file="$OPTARG"
;;
\?) show_usage
exit 1
;;
esac
done

# check if both -i and -w arguments were supplied
if [ -z "$image_file" ] || [ -z "$wad_file" ]; then
show_usage
exit 1
fi

# check if both files exist
if [ ! -f "$image_file" ] || [ ! -f "$wad_file" ]; then
echo "Error: One or both files do not exist."
exit 1
fi

# todo: run the DOOM experiment
# ...

# if successful, print JSON string
echo '{"doom": 1}'

# successful exit
exit 0

0 comments on commit 1998204

Please sign in to comment.