MCPcopy
hub / github.com/showlab/Show-o / get_code

Method get_code

models/modeling_magvitv2.py:423–427  ·  view source on GitHub ↗
(self, pixel_values)

Source from the content-addressed store, hash-verified

421 return output
422
423 def get_code(self, pixel_values):
424 hidden_states = self.encoder(pixel_values)
425 codebook_indices = self.quantize.get_indices(self.quantize(hidden_states)['z']).reshape(pixel_values.shape[0], -1)
426
427 return codebook_indices
428
429 def decode_code(self, codebook_indices, shape=None):
430 z_q = self.quantize.get_codebook_entry(codebook_indices, shape=shape)

Callers 5

inference_mmu.pyFile · 0.80
inference_t2i.pyFile · 0.80
mainFunction · 0.80

Calls 1

get_indicesMethod · 0.80

Tested by

no test coverage detected