MCPcopy Create free account
hub / github.com/JasonLSC/GSCodec_Studio / to_dict

Method to_dict

examples/codec_ply_sequence.py:225–243  ·  view source on GitHub ↗

Convert the CompressionConfig instance to a dictionary. If attribute_codec_registry is not None, it will be converted to a dictionary using its to_dict method.

(self)

Source from the content-addressed store, hash-verified

223 })
224
225 def to_dict(self) -> Dict[str, Any]:
226 """
227 Convert the CompressionConfig instance to a dictionary.
228 If attribute_codec_registry is not None, it will be converted to a dictionary using its to_dict method.
229 """
230 # Get only attributes defined in VideoCompressionConfig
231 video_compression_attrs = [
232 "use_sort", "verbose", "qp", "n_clusters",
233 "use_all_intra", "debug", "transform_attributes",
234 "chroma_subsampling", "use_chroma_qp_offset"
235 ]
236
237 result = {attr: getattr(self, attr) for attr in video_compression_attrs}
238
239 # handle attribute_codec_registry
240 if self.attribute_codec_registry is not None:
241 result["attribute_codec_registry"] = self.attribute_codec_registry.to_dict()
242
243 return result
244
245@dataclass
246class Config:

Callers

nothing calls this directly

Calls 1

to_dictMethod · 0.45

Tested by

no test coverage detected