# PG-COCO-ViT-b16

PG-COCO-ViT-b16 is a public classification model by Pictograph Research on Pictograph, trained on the COCO-CLS-5k dataset and exportable to ONNX for inference. Reported accuracy of 0.724.

## Overview

- Type: classification model
- Architecture: vit_b_16
- Owner: Pictograph Research
- Trained on: COCO-CLS-5k (https://pictograph.io/datasets/pictograph-research/coco-cls-5k)
- License: Custom License
- Export: ONNX
- Stars: 0
- Page: https://pictograph.io/models/pictograph-research/pg-coco-vit-b16
- Hugging Face: https://huggingface.co/pictograph/pg-coco-vit-b16

## Evaluation metrics

- f1: 62.2%
- recall: 61.4%
- accuracy: 72.4%
- precision: 66.2%

## About

# PG-COCO-ViT-b16

> A classification model (vit_b_16), trained on 55 classes, scoring 72.4% Accuracy.

**[Pictograph Research](/org/pictograph-research)** · Classification · vit_b_16 · FP32 · a custom license · Public

## Overview

This is a classification model built on **vit_b_16**, trained on the [COCO-CLS-5k](/datasets/pictograph-research/coco-cls-5k) dataset. It expects **224x224** input and runs in FP32 precision. It predicts skateboarding, skiing, bathroom, bird, frisbee, giraffe, and 49 more.

## Performance

Headline: **72.4% Accuracy**.

| Metric | Value |
| :--- | ---: |
| Accuracy | 72.4% |
| F1 | 62.2% |
| Precision | 66.2% |
| Recall | 61.4% |

### Per-class Accuracy

| Class | Accuracy |
| :--- | ---: |
| airplane | 94.4% |
| baseball | 85.2% |
| bathroom | 80.0% |
| beach | 0.0% |
| bear | 66.7% |
| bedroom | 40.0% |
| bench | 42.9% |
| bird | 88.9% |
| boat | 78.6% |
| bus | 74.1% |
| cake | 0.0% |
| cat | 90.9% |
| child | 0.0% |
| clock | 91.7% |
| dessert | 0.0% |
| dining | 59.1% |
| dog | 81.2% |
| donut | 50.0% |
| electronics | 66.7% |
| elephant | 100.0% |
| fire hydrant | 70.0% |
| formal wear | 61.5% |
| frisbee | 69.2% |
| fruit | 78.6% |
| giraffe | 90.0% |
| horse | 73.7% |
| hot dog | 50.0% |
| kitchen | 63.3% |
| kite | 62.5% |
| kitesurfing | 0.0% |

## Classes

Class index matches the model's output order.

| # | Class |
| ---: | :--- |
| 0 | skateboarding |
| 1 | skiing |
| 2 | bathroom |
| 3 | bird |
| 4 | frisbee |
| 5 | giraffe |
| 6 | soccer |
| 7 | teddy bear |
| 8 | elephant |
| 9 | vintage photo |
| 10 | bear |
| 11 | zebra |
| 12 | tennis |
| 13 | train |
| 14 | baseball |
| 15 | cat |
| 16 | dog |
| 17 | airplane |
| 18 | kitchen |
| 19 | kitesurfing |
| 20 | kite |
| 21 | boat |
| 22 | beach |
| 23 | surfing |
| 24 | horse |
| 25 | vase |
| 26 | livestock |
| 27 | bedroom |
| 28 | fruit |
| 29 | living room |
| 30 | market |
| 31 | motorcycle |
| 32 | portrait |
| 33 | clock |
| 34 | street |
| 35 | fire hydrant |
| 36 | bus |
| 37 | luggage |
| 38 | bench |
| 39 | pizza |
| 40 | office |
| 41 | electronics |
| 42 | child |
| 43 | video games |
| 44 | dining |
| 45 | formal wear |
| 46 | donut |
| 47 | dessert |
| 48 | meal |
| 49 | vegetables |
| 50 | cake |
| 51 | hot dog |
| 52 | street sign |
| 53 | stop sign |
| 54 | other |

## Training

| Setting | Value |
| :--- | :--- |
| Base dataset | [COCO-CLS-5k](/datasets/pictograph-research/coco-cls-5k) |
| Export | COCO-CLS-5k-base |
| Dataset size | 5,000 images |
| Input size | 224x224 |
| Epochs | 40 |
| Batch size | 32 |
| Precision | FP32 |
| Version | 1.0.0 |

## Use this model

Run inference with the Pictograph SDK:

```python
from pictograph import Client, get_model, ClassificationModel, ClassificationResult

client = Client(api_key="pk_live_...")  # Settings -> API Keys

# Downloads + caches the weights on first use
model: ClassificationModel = get_model(
    name="PG-COCO-ViT-b16",
    task="classification",
    format="onnx",
    precision="fp32",
    device="cpu",
    client=client,
)
result: ClassificationResult = model.predict(image="photo.jpg")
print(result)
```

```python
# Fully offline (no API key) once you have the weights + config.json
from pictograph import load_model, ClassificationModel, ClassificationResult

model: ClassificationModel = load_model(
    "/path/to/weights.onnx",
    "/path/to/config.json",
    task="classification",
    format="onnx",
)
result: ClassificationResult = model.predict(image="photo.jpg")
```

- Full inference guide: [local inference docs](https://pictograph.io/docs/local-inference).
- REST + CLI: [models API reference](https://pictograph.io/docs/api-reference/models).
- Deploy it as an always-on endpoint: [deployments](https://pictograph.io/docs/deployments).

## License

Released under a custom license.


---

Free to view. Sign in at https://app.pictograph.io to fork this model, run batch inference, or deploy it as a live endpoint.
