-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathall_process.sh
43 lines (34 loc) · 1.17 KB
/
all_process.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
#!/bin/bash
# Function to display usage
usage() {
echo "Usage: $0 [video file] [output directory]"
echo " video file - Path to the input video file"
echo " output directory - Path to the output directory"
exit 1
}
# Check if the correct number of arguments is provided
if [ $# -ne 2 ]; then
usage
fi
# Check if help is requested
if [[ $1 == "-h" || $1 == "--help" ]]; then
usage
fi
# Argument 1: Path to the input video file
video=$1
# Argument 2: Path to the output directory
output=$2
# Validate if the video file exists
if [ ! -f "$video" ]; then
echo "Error: Video file '$video' not found."
exit 1
fi
# Process data: Convert video to a format suitable for neural factoring
ns-process-data video --data "$video" --output-dir "$output" --sfm-tool hloc
# Train nerfacto model: Uses the processed data for training
ns-train nerfacto --vis viewer --data "$output"
# Export command commented out. Uncomment to enable export functionality.
cfg=`find . -name "config.yml" | xargs ls -lt | awk '{ print $NF }' | grep -v '^$' | head -n 1`
ns-export poisson --load-config $cfg --output-dir $output --normal-output-name rgb
echo "Output:"
echo $output