Skip to content

Commit b668eaa

Browse files
committed
feat: experimental all-intra mode coding
1 parent dd17e90 commit b668eaa

File tree

4 files changed

+229
-78
lines changed

4 files changed

+229
-78
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
# Define the list of GPU IDs to use
4+
GPU_IDS=(4 5 6 7) # You can modify this list, e.g., GPU_IDS=(0 2 5 7)
5+
6+
# Function to run a single experiment
7+
run_experiment() {
8+
local gpu_id=$1
9+
local rp_id=$2
10+
11+
echo "Starting experiment rp${rp_id} on GPU ${gpu_id}"
12+
13+
CUDA_VISIBLE_DEVICES=${gpu_id} python compress_ply_sequence.py x265_compression_rp${rp_id} \
14+
--data_factor 1 \
15+
--ply_dir /work/Users/lisicheng/Dataset/GSC_splats/m71763_bartender_stable/track \
16+
--data_dir /work/Users/lisicheng/Dataset/GSC_splats/m71763_bartender_stable/colmap_data \
17+
--result_dir results/mpeg150/video_anchor_all_intra/rp${rp_id} \
18+
--frame_num 16 \
19+
--lpips_net vgg \
20+
--no-normalize_world_space \
21+
--scene_type GSC \
22+
--test_view_id 9 11 \
23+
--compression_cfg.use_sort \
24+
--compression_cfg.use_all_intra
25+
26+
echo "Experiment rp${rp_id} started on GPU ${gpu_id}"
27+
}
28+
29+
# Check if the number of GPUs is sufficient
30+
if [ ${#GPU_IDS[@]} -lt 4 ]; then
31+
echo "Warning: Number of GPUs is less than the number of experiments, some experiments will be skipped"
32+
fi
33+
34+
# Launch experiments in parallel
35+
for i in {0..3}; do
36+
if [ $i -lt ${#GPU_IDS[@]} ]; then
37+
run_experiment ${GPU_IDS[$i]} $i &
38+
echo "Launched experiment rp${i} on GPU ${GPU_IDS[$i]} in background"
39+
else
40+
echo "Skipping experiment rp${i} due to insufficient GPUs"
41+
fi
42+
done
43+
44+
# Wait for all background processes to complete
45+
wait
46+
47+
echo "All experiments completed"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
3+
# Define the list of GPU IDs to use
4+
GPU_IDS=(4 5 6 7) # You can modify this list, e.g., GPU_IDS=(0 2 5 7)
5+
6+
# Function to run a single experiment
7+
run_experiment() {
8+
local gpu_id=$1
9+
local rp_id=$2
10+
11+
echo "Starting experiment rp${rp_id} on GPU ${gpu_id}"
12+
13+
CUDA_VISIBLE_DEVICES=${gpu_id} python compress_ply_sequence.py x265_compression_rp${rp_id} \
14+
--data_factor 1 \
15+
--ply_dir /work/Users/lisicheng/Dataset/GSC_splats/m71763_bartender_stable/track \
16+
--data_dir /work/Users/lisicheng/Dataset/GSC_splats/m71763_bartender_stable/colmap_data \
17+
--result_dir results/mpeg150/video_anchor_all_intra_debug/rp${rp_id} \
18+
--frame_num 16 \
19+
--lpips_net vgg \
20+
--no-normalize_world_space \
21+
--scene_type GSC \
22+
--test_view_id 9 11 \
23+
--compression_cfg.use_sort \
24+
--compression_cfg.use_all_intra \
25+
--compression_cfg.debug
26+
27+
echo "Experiment rp${rp_id} started on GPU ${gpu_id}"
28+
}
29+
30+
# Check if the number of GPUs is sufficient
31+
if [ ${#GPU_IDS[@]} -lt 4 ]; then
32+
echo "Warning: Number of GPUs is less than the number of experiments, some experiments will be skipped"
33+
fi
34+
35+
# Launch experiments in parallel
36+
for i in {0..3}; do
37+
if [ $i -lt ${#GPU_IDS[@]} ]; then
38+
run_experiment ${GPU_IDS[$i]} $i &
39+
echo "Launched experiment rp${i} on GPU ${GPU_IDS[$i]} in background"
40+
else
41+
echo "Skipping experiment rp${i} due to insufficient GPUs"
42+
fi
43+
done
44+
45+
# Wait for all background processes to complete
46+
wait
47+
48+
echo "All experiments completed"

examples/compress_ply_sequence.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ class VideoCompressionConfig(CompressionConfig):
114114
n_clusters: int = 32768
115115
# Maps attribute names to their codec functions
116116
attribute_codec_registry: Optional[AttributeCodecs] = field(default_factory=lambda: AttributeCodecs())
117+
# Enable All Intra coding mode
118+
use_all_intra: bool = False
117119
# Enable debug mode
118120
debug: bool = False
119121

@@ -122,13 +124,13 @@ def to_dict(self) -> Dict[str, Any]:
122124
Convert the CompressionConfig instance to a dictionary.
123125
If attribute_codec_registry is not None, it will be converted to a dictionary using its to_dict method.
124126
"""
125-
result = {
126-
"use_sort": self.use_sort,
127-
"verbose": self.verbose,
128-
"qp": self.qp,
129-
"n_clusters": self.n_clusters,
130-
"debug": self.debug,
131-
}
127+
# Get only attributes defined in VideoCompressionConfig
128+
video_compression_attrs = [
129+
"use_sort", "verbose", "qp", "n_clusters",
130+
"use_all_intra", "debug"
131+
]
132+
133+
result = {attr: getattr(self, attr) for attr in video_compression_attrs}
132134

133135
# handle attribute_codec_registry
134136
if self.attribute_codec_registry is not None:

0 commit comments

Comments
 (0)