yuhangzang commited on
Commit
b4bcbcf
·
1 Parent(s): bfa0114
Files changed (1) hide show
  1. app.py +8 -11
app.py CHANGED
@@ -92,7 +92,7 @@ def generate_caption(image: Image.Image):
92
 
93
 
94
  with gr.Blocks(title="CapRL Image Captioning") as demo:
95
- gr.Markdown("# 🎨 CapRL Image Captioning")
96
  gr.Markdown("### CapRL: Stimulating Dense Image Caption Capabilities via Reinforcement Learning")
97
  gr.Markdown("✨ Upload an image to generate a detailed caption with CapRL-3B! ✨")
98
  gr.Markdown(
@@ -109,7 +109,7 @@ with gr.Blocks(title="CapRL Image Captioning") as demo:
109
  image_input = gr.Image(type="pil", label="Input Image")
110
  generate_button = gr.Button("Generate Caption")
111
  with gr.Column():
112
- caption_output = gr.Textbox(label="Caption", lines=6)
113
  token_output = gr.Number(label="Generated Tokens", precision=0)
114
 
115
  generate_button.click(
@@ -137,20 +137,17 @@ with gr.Blocks(title="CapRL Image Captioning") as demo:
137
  label="📸 Example Images"
138
  )
139
 
140
- gr.Markdown(
141
- """### Citation
142
- If you find this project useful, please kindly cite:
143
 
144
- ```
145
- @article{xing2025caprl,
146
  title={{CapRL}: Stimulating Dense Image Caption Capabilities via Reinforcement Learning},
147
  author={Xing, Long and Dong, Xiaoyi and Zang, Yuhang and Cao, Yuhang and Liang, Jianze and Huang, Qidong and Wang, Jiaqi and Wu, Feng and Lin, Dahua},
148
  journal={arXiv preprint arXiv:2509.22647},
149
  year={2025}
150
- }
151
- ```
152
- """
153
- )
154
 
155
 
156
  demo.launch()
 
92
 
93
 
94
  with gr.Blocks(title="CapRL Image Captioning") as demo:
95
+ gr.Markdown("# 🎨 CapRL for Image Captioning")
96
  gr.Markdown("### CapRL: Stimulating Dense Image Caption Capabilities via Reinforcement Learning")
97
  gr.Markdown("✨ Upload an image to generate a detailed caption with CapRL-3B! ✨")
98
  gr.Markdown(
 
109
  image_input = gr.Image(type="pil", label="Input Image")
110
  generate_button = gr.Button("Generate Caption")
111
  with gr.Column():
112
+ caption_output = gr.Textbox(label="Caption", lines=6, show_copy_button=True)
113
  token_output = gr.Number(label="Generated Tokens", precision=0)
114
 
115
  generate_button.click(
 
137
  label="📸 Example Images"
138
  )
139
 
140
+ gr.Markdown("### Citation")
141
+ gr.Markdown("If you find this project useful, please kindly cite:")
 
142
 
143
+ citation_text = """@article{xing2025caprl,
 
144
  title={{CapRL}: Stimulating Dense Image Caption Capabilities via Reinforcement Learning},
145
  author={Xing, Long and Dong, Xiaoyi and Zang, Yuhang and Cao, Yuhang and Liang, Jianze and Huang, Qidong and Wang, Jiaqi and Wu, Feng and Lin, Dahua},
146
  journal={arXiv preprint arXiv:2509.22647},
147
  year={2025}
148
+ }"""
149
+
150
+ gr.Code(value=citation_text, language="bibtex", label="BibTeX Citation", show_copy_button=True)
 
151
 
152
 
153
  demo.launch()