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

Method to_dict

examples/compress_ply_sequence.py:145–163  ·  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

143 })
144
145 def to_dict(self) -> Dict[str, Any]:
146 """
147 Convert the CompressionConfig instance to a dictionary.
148 If attribute_codec_registry is not None, it will be converted to a dictionary using its to_dict method.
149 """
150 # Get only attributes defined in VideoCompressionConfig
151 video_compression_attrs = [
152 "use_sort", "verbose", "qp", "n_clusters",
153 "use_all_intra", "debug", "transform_attributes",
154 "chroma_subsampling", "use_chroma_qp_offset"
155 ]
156
157 result = {attr: getattr(self, attr) for attr in video_compression_attrs}
158
159 # handle attribute_codec_registry
160 if self.attribute_codec_registry is not None:
161 result["attribute_codec_registry"] = self.attribute_codec_registry.to_dict()
162
163 return result
164
165@dataclass
166class Config:

Callers

nothing calls this directly

Calls 1

to_dictMethod · 0.45

Tested by

no test coverage detected