twodgirl commited on
Commit
4bdfd4e
·
verified ·
1 Parent(s): 82da364

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +2 -2
README.md CHANGED
@@ -41,7 +41,7 @@ def image_to_indices(image, vq):
41
 
42
  return indices, norm
43
 
44
- def norm_to_tensor(indices, vq, ada: AdaLayerNorm):
45
  b = indices.shape[0]
46
  w = int(indices.shape[-1] ** 0.5)
47
  v = vq.quantize.embedding(indices)
@@ -61,7 +61,7 @@ if __name__ == '__main__':
61
  # Encode image.
62
  ids, _ = image_to_indices(image, vq)
63
  # Decode by integer ids.
64
- pixel_values = tokenizer.norm_to_tensor(ids, vq, ada) / 2.0 + 0.5
65
  preview = transforms.functional.to_pil_image(pixel_values.detach().squeeze(0).to('cpu'))
66
  ```
67
 
 
41
 
42
  return indices, norm
43
 
44
+ def indices_to_tensor(indices, vq, ada: AdaLayerNorm):
45
  b = indices.shape[0]
46
  w = int(indices.shape[-1] ** 0.5)
47
  v = vq.quantize.embedding(indices)
 
61
  # Encode image.
62
  ids, _ = image_to_indices(image, vq)
63
  # Decode by integer ids.
64
+ pixel_values = indices_to_tensor(ids, vq, ada) / 2.0 + 0.5
65
  preview = transforms.functional.to_pil_image(pixel_values.detach().squeeze(0).to('cpu'))
66
  ```
67