Skip to content
Other

Kafwain Produce Freshness (ViT)

свежесть фруктов и овощей по одному фото

1 min readupdated

ViT-Base (patch 16) на 85.8M параметров, дообученный от google/vit-base-patch16-224. Автор — команда Kafwain, студенческого стартапа из Дохи (Катар), который связывает местных фермеров с ресторанами через единую доставку. Модель — прототип: на пункте приёмки сотрудник фотографирует товар, а классификатор подсказывает, не испорчен ли он.

Ключевые особенности

  • Вход — одно RGB-изображение 224×224, выход — вероятность по каждому классу.
  • Метка объединяет тип продукта и состояние: свежий или испорченный.
  • 99.68% accuracy на eval-наборе — но автор прямо называет это верхней границей, а не реальной точностью.
  • Рекомендуется порог уверенности (стартово 0.80): сомнительные снимки уходят человеку на проверку.
  • Запускается через pipeline из transformers, лицензия Apache-2.0.
  • Задумана как помощник: финальное «принять / отклонить» всегда за сотрудником.

Пример

from transformers import pipeline

classifier = pipeline("image-classification", model="v3loc1ty/kafwain-produce-freshness-vit")
print(classifier("produce_photo.jpg"))
ПодробнееФайнтюн через HF Trainer: 4 эпохи, lr 5e-05, batch 32, AdamW, mixed precision; итог — loss 0.0123.
Оценка оптимистична: eval-снимки из тех же источников и условий, что и train, возможны дубликаты одного объекта.
Список меток в карточке не заполнен — какие именно продукты поддерживаются, из README неясно.
На фото с ящиками, тенями и смешанным товаром точность будет ниже; на собственных снимках приёмки модель ещё не тестировали.
Не подходит для решений о безопасности еды и для автоматического отказа фермерам.
Discuss Telegram 0 4

Will it run?

Working out the memory needs

The bot is still collecting this model's weight sizes; the estimate will appear here in a few minutes. Meanwhile you can rent a GPU with headroom.

Massed ComputeOpen Massed Compute

Run it on Massed Compute

The script downloads the model to the rented machine. How to run it is in the model card.

  1. 1. Rent a machine with a fitting GPU

    Open Massed Compute
  2. 2. Paste the script into the machine's terminal

    Connect over SSH (the Massed Compute panel shows the command) or open a terminal on the machine's desktop.

    HF_TOKEN / CIVITAI_TOKENThe script starts with token lines: paste yours between the quotes. The Hugging Face token is for gated models, the Civitai one for Civitai models.

    # v3loc1ty/kafwain-produce-freshness-vit
    mkdir -p ~/models
    curl -LsSf https://astral.sh/uv/install.sh | sh
    source "$HOME/.local/bin/env"
    uv tool install "huggingface_hub[cli]"
    hf download v3loc1ty/kafwain-produce-freshness-vit --local-dir ~/models/kafwain-produce-freshness-vit
    # The model is in ~/models. How to run it is in the model card (link above).
  3. 3. Use it

    The model is in ~/models. How to run it is in the model card (link above).

Stop the machine in the panel when you are done: it bills by the minute while it runs.

How to speed it up

Picked for this model type. Choose your hardware above to see what fits you exactly.

  • FlashAttention 44.0.0b40from November 18, 2026new release

    fastest exact attention on B200

    Kernels for Blackwell (beta). Exact attention without quantisation — fine for everything, LLMs included.

    How to enable: pip install flash-attn-4; vLLM and SGLang pick it up themselves.

    Earlier generations (2)
    • FlashAttention 3 — The Hopper (H100/H200) version with FP8.
    • FlashAttention 2 — The standard for RTX 30/40/50 and A100: exact attention without the memory cost of long contexts.
  • torch.compile2.15.0from October 28, 2026new release

    10–30% for free

    Compiles the model for your GPU. Slower first run, faster afterwards.

    How to enable: model = torch.compile(model); in ComfyUI the TorchCompileModel node.

Model family

New posts about versions of kafwain-produce-freshness-vit (quants, finetunes, LoRAs) will show up under the bell.

No known relatives of this model yet. All derivatives on Hugging Face

About the model

v3loc1ty/kafwain-produce-freshness-vit
Author
v3loc1ty
Category
Other
Released
Posted

On NeyroLearn

Hugging Face

40

Ask AI about this model

Answered by Gemini 4 · the chat is kept only in this tab

Comments