cnmoro / tiny-image-captioning

huggingface.co
Total runs: 489
24-hour runs: -10
7-day runs: 36
30-day runs: -85
Model's Last Updated: January 28 2025
image-to-text

Introduction of tiny-image-captioning

Model Details of tiny-image-captioning

An image captioning model, based on bert-tiny and vit-small, weighing only 100mb!

Works very fast on CPU.

from transformers import AutoTokenizer, AutoImageProcessor, VisionEncoderDecoderModel
import requests, time
from PIL import Image

model_path = "cnmoro/tiny-image-captioning"

# load the image captioning model and corresponding tokenizer and image processor
model = VisionEncoderDecoderModel.from_pretrained(model_path)
tokenizer = AutoTokenizer.from_pretrained(model_path)
image_processor = AutoImageProcessor.from_pretrained(model_path)

# preprocess an image
url = "https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/New_york_times_square-terabass.jpg/800px-New_york_times_square-terabass.jpg"
image = Image.open(requests.get(url, stream=True).raw)
pixel_values = image_processor(image, return_tensors="pt").pixel_values

start = time.time()

# generate caption - suggested settings
generated_ids = model.generate(
    pixel_values,
    temperature=0.7,
    top_p=0.8,
    top_k=50,
    num_beams=3 # you can use 1 for even faster inference with a small drop in quality
)
generated_text = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]

end = time.time()

print(generated_text)
# a group of people walking in the middle of a city.

print(f"Time taken: {end - start} seconds")
# Time taken: 0.11215853691101074 seconds
# on CPU !

Runs of cnmoro tiny-image-captioning on huggingface.co

489
Total runs
-10
24-hour runs
17
3-day runs
36
7-day runs
-85
30-day runs

More Information About tiny-image-captioning huggingface.co Model

More tiny-image-captioning license Visit here:

https://choosealicense.com/licenses/apache-2.0

tiny-image-captioning huggingface.co

tiny-image-captioning huggingface.co is an AI model on huggingface.co that provides tiny-image-captioning's model effect (), which can be used instantly with this cnmoro tiny-image-captioning model. huggingface.co supports a free trial of the tiny-image-captioning model, and also provides paid use of the tiny-image-captioning. Support call tiny-image-captioning model through api, including Node.js, Python, http.

tiny-image-captioning huggingface.co Url

https://huggingface.co/cnmoro/tiny-image-captioning

cnmoro tiny-image-captioning online free

tiny-image-captioning huggingface.co is an online trial and call api platform, which integrates tiny-image-captioning's modeling effects, including api services, and provides a free online trial of tiny-image-captioning, you can try tiny-image-captioning online for free by clicking the link below.

cnmoro tiny-image-captioning online free url in huggingface.co:

https://huggingface.co/cnmoro/tiny-image-captioning

tiny-image-captioning install

tiny-image-captioning is an open source model from GitHub that offers a free installation service, and any user can find tiny-image-captioning on GitHub to install. At the same time, huggingface.co provides the effect of tiny-image-captioning install, users can directly use tiny-image-captioning installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

tiny-image-captioning install url in huggingface.co:

https://huggingface.co/cnmoro/tiny-image-captioning

Url of tiny-image-captioning

tiny-image-captioning huggingface.co Url

Provider of tiny-image-captioning huggingface.co

cnmoro
ORGANIZATIONS

Other API from cnmoro

huggingface.co

Total runs: 35
Run Growth: 4
Growth Rate: 11.43%
Updated:April 09 2026
huggingface.co

Total runs: 32
Run Growth: 32
Growth Rate: 100.00%
Updated:August 05 2026
huggingface.co

Total runs: 7
Run Growth: 6
Growth Rate: 85.71%
Updated:January 14 2025