@@ -87,7 +87,7 @@ preprocess = transforms.Compose([
8787image = preprocess(Image.open(" figures/dog.png" )).unsqueeze(0 )
8888
8989# ---------------------------------------------------------------------------------------
90- # use it as auto-encoder; rFID=0.36
90+ # use it as an auto-encoder; rFID=0.36
9191# ---------------------------------------------------------------------------------------
9292denormalize = transforms.Normalize(
9393 mean = [- 0.485 / 0.229 , - 0.456 / 0.224 , - 0.406 / 0.225 ],
@@ -101,7 +101,7 @@ Image.fromarray((recon_image * 255).astype("uint8")).save("output/reconstructed.
101101
102102
103103# ---------------------------------------------------------------------------------------
104- # use it as clip; zero-shot 78.2
104+ # use it as a clip; zero-shot 78.2
105105# ---------------------------------------------------------------------------------------
106106tokenizer = get_tokenizer(' ViT-B-32' , context_length = model.config.text_context_length)
107107text = tokenizer([" a diagram" , " a dog" , " a cat" , " a person" ])
@@ -112,7 +112,7 @@ with torch.no_grad(), torch.autocast("cuda"):
112112print (" Label probs:" , [f " { p:.4f } " for p in text_probs[0 ].tolist()])
113113
114114# ---------------------------------------------------------------------------------------
115- # use it as ssl feature extractor; linear probing 85.7
115+ # use it as an ssl feature extractor; linear probing 85.7
116116# ---------------------------------------------------------------------------------------
117117with torch.no_grad(), torch.autocast(" cuda" ):
118118 # get last layer features (cls token + patch tokens)
@@ -248,4 +248,4 @@ Thanks for their great codes.
248248
249249## Contact Us
250250
251- Contact us at model@minimax.io .
251+ Contact us at model@minimax.io .
0 commit comments