Skip to content

Commit 3d4f1c2

Browse files
committed
[fix] remote anchor available
1 parent afaa67a commit 3d4f1c2

File tree

11 files changed

+23
-8
lines changed

11 files changed

+23
-8
lines changed

cfgs/codec/hm.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ encoder_config:
2929
chroma_format: "400" # "420" for remote inference
3030
input_bitdepth: 10
3131
output_bitdepth: 10
32+
use_yuv: False

cfgs/codec/jm.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ encoder_config:
3030
chroma_format: "400" # "420" for remote inference
3131
input_bitdepth: 10
3232
output_bitdepth: 10
33+
use_yuv: False

cfgs/codec/vtm.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ dump:
2020
dump_yuv_packing_dec: False
2121
yuv_packing_dec_dir: ${..output_dir}
2222
fpn_sizes_json_dump: False
23+
2324
encoder_config:
2425
qp: 42
2526
intra_period: 1
@@ -29,3 +30,4 @@ encoder_config:
2930
chroma_format: "400" # "420" for remote inference
3031
input_bitdepth: 10
3132
output_bitdepth: 10
33+
use_yuv: False

cfgs/codec/vvenc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ encoder_config:
2626
stash_outputs: True
2727
chroma_format: "420"
2828
input_bitdepth: 8
29+
use_yuv: False

compressai_vision/codecs/encdec_utils/png_yuv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ def _determine_output_filename(self, output_file_prefix: str):
304304
datacatalog = self.datacatalog
305305

306306
# TODO (fracape) hacky, clean this
307-
if datacatalog == "MPEGOIV6":
307+
if datacatalog in ["MPEGOIV6", "MPEGSAM"]:
308308
cmd_suffix = []
309309
filename = f"{output_file_prefix}.png"
310310
elif datacatalog == "SFUHW":

compressai_vision/model_wrappers/sam.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def forward(self, x):
296296
for k, v in zip(self.split_layer_list, enc_res["data"].values())
297297
}
298298

299-
prompts, object_classes = self.prompt_inputs(x["file_name"])
299+
prompts, object_classes = self.prompt_inputs(x["file_origin"])
300300

301301
dec_res = self._image_encoder_to_output(
302302
enc_res["data"],

compressai_vision/pipelines/remote_inference/image_remote_inference.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,10 @@ def __call__(
155155
timing["decode"].append((end - start))
156156

157157
start = time_measure()
158-
dec_d = {"file_name": dec_seq["file_names"][0]}
158+
dec_d = {
159+
"file_name": dec_seq["file_names"][0],
160+
"file_origin": d[0]["file_name"],
161+
}
159162
# dec_d = {"file_name": dec_seq[0]["file_names"][0]}
160163

161164
pred = vision_model.forward(org_map_func(dec_d))

compressai_vision/pipelines/remote_inference/video_remote_inference.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,10 @@ def __call__(
184184
# some assertion needed to check if d is matched with dec_seq[e]
185185

186186
start = time_measure()
187-
dec_d = {"file_name": dec_seq["file_names"][e]}
187+
dec_d = {
188+
"file_name": dec_seq["file_names"][e],
189+
"file_origin": d[e]["file_name"],
190+
}
188191
# dec_d = {"file_name": dec_seq[0]["file_names"][e]}
189192
pred = vision_model.forward(org_map_func(dec_d))
190193
end = time_measure()

compressai_vision/pipelines/split_inference/image_split_inference.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ def __call__(
198198
dec_features["input_size"] = self._get_model_input_size(vision_model, d)
199199

200200
dec_features["file_name"] = d[0]["file_name"]
201+
dec_features["file_origin"] = d[0]["file_name"]
201202
if self.is_mac_calculation:
202203
macs, pixels = calc_complexity_nn_part2_plyr(
203204
vision_model, dec_features["data"], dec_features

compressai_vision/pipelines/split_inference/video_split_inference.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ def __call__(
291291
data = {k: v.to(self.device_nn_part2) for k, v in ftensors.items()}
292292
dec_features["data"] = data
293293
dec_features["file_name"] = file_names[e]
294+
dec_features["file_origin"] = file_names[e]
294295
dec_features["qp"] = (
295296
"uncmp" if codec.qp_value is None else codec.qp_value
296297
) # Assuming one qp will be used

0 commit comments

Comments
 (0)