carolineec commited on
Commit
a4d1dcd
·
verified ·
1 Parent(s): 1223350

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +51 -4
README.md CHANGED
@@ -2,9 +2,56 @@
2
  tags:
3
  - model_hub_mixin
4
  - pytorch_model_hub_mixin
 
 
 
 
 
 
5
  ---
6
 
7
- This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:
8
- - Code: [More Information Needed]
9
- - Paper: [More Information Needed]
10
- - Docs: [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  tags:
3
  - model_hub_mixin
4
  - pytorch_model_hub_mixin
5
+ license: mit
6
+ datasets:
7
+ - carolineec/CyclePrefDB-I2T
8
+ - carolineec/CyclePrefDB-T2I
9
+ language:
10
+ - en
11
  ---
12
 
13
+ # Model Card for CycleReward-Combo
14
+
15
+ [Project page](https://cyclereward.github.io) | [Paper](https://huggingface.co/papers/2506.02095) | [Code](https://github.com/hjbahng/cyclereward)
16
+
17
+ Reward model for image-text alignment trained on both image-to-text and text-to-image comparison pairs from [CyclePrefDB-I2T](https://huggingface.co/datasets/carolineec/CyclePrefDB-I2T) and [CyclePrefDB-T2I](https://huggingface.co/datasets/carolineec/CyclePrefDB-T2I) datasets.
18
+
19
+ This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration.
20
+
21
+
22
+ ## Loading the model
23
+
24
+ Download the `model.py`, `med_config.json` files and `blip` folder from this repository. You can load the pretrained model using the code below:
25
+
26
+
27
+ ```
28
+ import torch
29
+ from PIL import Image
30
+ from model import CycleReward
31
+
32
+ device='cuda'
33
+ model = CycleReward.from_pretrained("carolineec/CycleReward-Combo")
34
+ model.to(device)
35
+ model.eval()
36
+
37
+ preprocess = model.preprocess
38
+ image_path = "cat.jpg"
39
+ caption = "a photo of a cat"
40
+ image = preprocess(Image.open(image_path)).unsqueeze(0).to(device)
41
+ print('prepared data')
42
+
43
+ score = model.score(image, caption)
44
+ print('my score:', score.item())
45
+
46
+ ```
47
+
48
+ ## Citation
49
+
50
+ ```
51
+ @article{bahng2025cyclereward,
52
+ title={Cycle Consistency as Reward: Learning Image-Text Alignment without Human Preferences},
53
+ author= {Bahng, Hyojin and Chan, Caroline and Durand, Fredo and Isola, Phillip},
54
+ journal={arXiv preprint arXiv:2506.02095},
55
+ year={2025}
56
+ }
57
+ ```