forked from SensorsINI/v2e
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathframes2events_quick.sh
executable file
·57 lines (46 loc) · 1.77 KB
/
frames2events_quick.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
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
# Source the virtual environment in the root folder of the v2e repository
DIR="$( cd "$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )" && pwd )"
echo "frame2events_quick script directory: $DIR"
v2e_location=$(which v2e)
echo "v2e location: $v2e_location"
# If empty string, then v2e is not in the PATH
if [ -z "$v2e_location" ]; then
echo "v2e is not in the PATH. Have you installed v2e by running install_v2e_linux? There should be a symlink in /usr/local/bin."
exit 1
fi
# Save the current directory
current_dir=$(pwd)
echo "Sourcing virtual environment in $DIR"
cd $DIR
source .venvEventBased/bin/activate
cd $current_dir
# Check if exactly two arguments are passed
if [ "$#" -lt 2 ]; then
echo "Usage: $0 <input_folder> <input_framerate>"
exit 1
fi
# Check if the third argument is passed
if [ "$#" -lt 3 ]; then
echo "Event threshold not provided. Using default value of 0.05."
fi
event_thr=${3:-0.06} # Set a default value if the third argument is not provided
# Assign inputs to variables
input_folder=$1
input_framerate=$2
#output_folder=$3
echo "Input folder path: $input_folder"
echo "Input framerate: $input_framerate"
echo "Event threshold: $event_thr"
# Get location of v2e.py from whichs
#--auto_timestamp_resolution
#--timestamp_resolution 0.05
# --dvs_exposure count 1000
python $v2e_location -i $input_folder \
--timestamp_resolution 0.05 --save_dvs_model_state --show_dvs_model_state all \
--vid_orig None --crop '256, 256, 256, 256' --dvs_exposure duration 0.05 --input_frame_rate $input_framerate \
--pos_thres $event_thr --neg_thres $event_thr --photoreceptor_noise \
--batch_size 8 --output_height 512 --output_width 512 --slomo_stats_plot --cutoff_hz 0.5 \
--dvs_text events_stream_txt --ddd_output
# Deactivate the virtual environment
#deactivate