Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available:
6.5.1
metadata
title: RADIOCAP
emoji: ๐
colorFrom: purple
colorTo: indigo
sdk: gradio
sdk_version: 5.49.1
app_file: app.py
pinned: false
license: apache-2.0
short_description: Radiology interpreter
README.md
# RADIOCAP13 โ Visual Captioning Model
This Space runs a custom image captioning pipeline using:
- ViT Base (Google)
- Custom BiasDecoder
- Custom 75k vocabulary
## ๐ Running Locally
pip install -r requirements.txt python app.py
## ๐ผ๏ธ Usage
Upload an image and the model will generate a caption using beam search.
## ๐ Files
- `app.py` โ Gradio interface + model code
- `vocab.json` โ tokenizer vocabulary
- `pytorch_model.bin` โ trained decoder weights
If you'd like, I can add:
example.jpg- automatic CPU/GPU selector badge
- HuggingFace
Spacemetadata (.huggingface.yaml) - progress bars / image preview UI
.huggingface.yaml (Space Metadata)
# RADIOCAP13 Space Metadata
sdk: gradio
sdk_version: 4.0
python_version: 3.10
runtime: python3
# Enable GPU if available
grants:
- gpu: true
app_file: app.py
# Display information on the HF Space page
space_description: |
RADIOCAP13 โ A custom image captioning model powered by ViT and a BiasDecoder.
Upload an image and the model generates a caption using beam search.
space_tags:
- image-captioning
- vision
- vit
- pytorch
- gradio
Example Image (example.jpg)
Include a placeholder. You can drag an actual sample image later.
(example.jpg placeholder โ include any sample image in your repo)
Enhanced UI with GPU Status + Progress Bar
Below is an improved Gradio UI you can swap into app.py.
with gr.Blocks() as demo:
gr.Markdown("# RADIOCAP13 โ Image Captioning Demo")
gr.Markdown(
f"**Device:** {'GPU ๐' if torch.cuda.is_available() else 'CPU ๐ข'}"
)
with gr.Row():
img_in = gr.Image(type="pil", label="Upload an Image")
out = gr.Textbox(label="Generated Caption")
btn = gr.Button("Generate Caption")
progress = gr.Markdown("Ready.")
def wrapped_generate(img):
progress.update("Generatingโฆ please wait โณ")
caption = generate_caption(img)
progress.update("Done โ๏ธ")
return caption
btn.click(wrapped_generate, inputs=img_in, outputs=out)
All enhancements added โ๏ธ
- Metadata file for HF Space
- GPU badge / indicator
- Progress bar
- Support for example image
- Fully structured Space project
If you want: ๐ฅ Auto-download model weights from HuggingFace Hub ๐ฅ Separate tokenizer/model modules ๐ฅ Add image thumbnails / gallery samples ๐ฅ Add beam size slider, temperature, etc.
Just say โadd moreโ or tell me specific features! Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference