Run this model with HF Jobs

Run laszlokiss27/doodle-dash2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/laszlokiss27/doodle-dash2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/laszlokiss27/doodle-dash2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Model description

This is a fine-tuned model based on apple/mobilevitv2-1.0-imagenet1k-256 trained for sketch image recognition using Xenova/quickdraw-small dataset.

How to use?

from transformers import MobileViTImageProcessor, MobileViTV2ForImageClassification
from PIL import Image
import requests
import torch
import numpy as np  # Importing NumPy

url = "https://static.thenounproject.com/png/2024184-200.png"
response = requests.get(url, stream=True)

# Convert to grayscale to ensure a single channel input
image = Image.open(response.raw).convert('L')  # Convert to grayscale

processor = MobileViTImageProcessor.from_pretrained("laszlokiss27/doodle-dash2")
model = MobileViTV2ForImageClassification.from_pretrained("laszlokiss27/doodle-dash2")

# Convert the PIL image to a tensor and add a channel dimension
image_tensor = torch.unsqueeze(torch.tensor(np.array(image)), 0).float()
image_tensor = image_tensor.unsqueeze(0)  # Add batch dimension

# Check if processor requires specific form of input
inputs = processor(images=image_tensor, return_tensors="pt")

outputs = model(**inputs)
logits = outputs.logits

# Get prediction
predicted_class_idx = logits.argmax(-1).item()
predicted_class = model.config.id2label[predicted_class_idx]
print("Predicted class:", predicted_class)
Downloads last month
22
Safetensors
Model size
4.58M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for laszlokiss27/doodle-dash2

Finetunes
1 model