This repository contains a modular scratch detection system based on CLIP embeddings and various classification models.
- NVIDIA P100 (2GB) {Kaggle}
Install the required packages using:
pip install -r requirements.txt- When changing the classification model, you must update the model input dimensions accordingly.
Class: Scratches
| Models | VIT-B-32 | Convnext_base_w |
|---|---|---|
| Precision | 0.8333 | 0.8750 |
| F1 Score | 0.7895 | 0.8235 |
| Recall | 0.7500 | 0.8485 |
- Rename bad images to
scratchesand good images tono_scratches. - Place the images in a designated directory.
- Prefer using a Kaggle notebook to replicate the exact results.
- Adjust the dataset path as required.
- Install dependencies using:
pip install -r requirements.txt
- Update the configuration block and ensure the input dimensions are adjusted if changing the classification head.
- Modify the learning rate, weight decay, and batch size according to the model. The current configuration is optimized for
convnext_base_w.
- Download model weights for VIT-32(512) and convnext_base_w(640)
- Change the weights path in notebook and chnage image path to test
- It achieves a classification accuracy of 70.1% on zero-shot tasks.