isHotdog

isHotdog is a small MobileNetV3 image classifier inspired by the Silicon Valley "Hotdog / Not Hotdog" joke.

It answers one question:

Hotdog
Not Hotdog

Project Structure

hotvision/
  app.py                 Gradio UI
  hotvision_model.py     model loading and prediction logic
  prepare_data.py        creates Food-101 binary dataset
  train.py               trains MobileNetV3 Small
  predict.py             CLI prediction
  requirements.txt       dependencies
  README.md              internal project notes

Generated local folders:

dataset/                 prepared train/val image-folder dataset
raw_data/                Food-101 cache
model/isHotdog.pt        trained model checkpoint
photos/                  local test images

Install

cd models/hotvision
python3.12 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Prepare Dataset

isHotdog can use three sources:

  • Food-101: hot_dog as Hotdog, selected other foods as Not Hotdog
  • antareepdey/Hotdog-or-not-a-hotdog: local hotdog / others images
  • hotdog-nothotdog: local train/test hotdog / nothotdog images
  • bghira/not-a-hotdog: hard negative not-hotdog images

Your downloaded Hugging Face datasets should be here:

datasets/
  datasets--antareepdey--Hotdog-or-not-a-hotdog/
  datasets--bghira--not-a-hotdog/
  hotdog-nothotdog/

Prepare the best mixed dataset:

python prepare_data.py --overwrite

Prepare only from the local Hugging Face datasets, without downloading Food-101:

python prepare_data.py --overwrite --no-food101

Use all bghira hard negatives instead of the default quick subset:

python prepare_data.py --overwrite --no-food101 --max-bghira 0

Output:

dataset/train/hotdog
dataset/train/not_hotdog
dataset/val/hotdog
dataset/val/not_hotdog

Recommended: use the mixed dataset if you can download Food-101. Use local-only if you want the fastest setup with the datasets already downloaded.

Train

python train.py --epochs 8 --batch 32

On macOS the default uses --num-workers 0 because it is the most stable option with local functions and Python multiprocessing.

If training on CPU, use a smaller batch:

python train.py --epochs 8 --batch 16

If pretrained MobileNetV3 weights cannot be downloaded, train from scratch:

python train.py --epochs 12 --batch 16 --no-pretrained

The model is saved to:

model/isHotdog.pt

CLI Prediction

Put images into:

photos/

Run:

python predict.py

Or run one image:

python predict.py path/to/image.jpg

Example output:

test.jpg: โœ… Hotdog confidence=94.20% hotdog_probability=94.20%

Web App

python app.py

The interface shows:

โœ… Hotdog

or:

โŒ Not Hotdog

Threshold

Default threshold:

0.60

Meaning: isHotdog says Hotdog only if hotdog probability is at least 60%.

Use a stricter threshold for fewer false hotdogs:

python predict.py photo.jpg --threshold 0.75

Notes

  • This is a classifier, not object detection.
  • It does not draw boxes because the task only needs binary image-level output.
  • MobileNetV3 Small is used because it is light, fast, and good enough for this joke/product.
  • Do not commit dataset/, raw_data/, model/, runs/, or local photos.
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support