Downloads · 30 days
0
tahaz122/cnn-autoencoder
cnn-autoencoder is a machine learning model from tahaz122. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
[](https://www.python.org/downloads/) [](https://pytorch.org/) [](https://gradio.app/) [](https://opensource.org/licenses/MIT)
Downloads · 30 days
0
Access
Public
Updated Sep 20, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py54.8 KB · 89%
From the Hugging Face model README
An end-to-end unsupervised visual inspection framework built with PyTorch and Gradio. This system utilizes a Convolutional Autoencoder with a compressed bottleneck vector to detect, locate, and measure manufacturing defects on high-resolution industrial components (e.g., MVTec AD dataset).
JET colormap) on original input images.├── code/
│ ├── datascience_project.py # Core PyTorch Autoencoder & Anomalib training script
│ ├── datascience_project_collab.ipynb # Google Colab experiment notebook
│ └── debug.py # Diagnostic utilities & testing helpers
├── app.py # Gradio web application for visual inspection UI
├── requirements.txt # Python environment dependencies
└── .gitignore # Configured to exclude heavy binaries & weights
Clone the repository:
git clone https://github.com/<your-username>/anomaly-detection.git
cd anomaly-detection
Create a virtual environment & install dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
To train the autoencoder model on your own dataset or MVTec AD dataset:
python code/datascience_project.py
code/datascience_project_collab.ipynb in Google Colab for GPU-accelerated training.To launch the interactive visual inspection UI locally:
python app.py
Open the generated local URL (e.g., http://127.0.0.1:7860) in your web browser.
Note on Model Checkpoint: Place your trained weights (
autoencoder_mvtec.pth) in the root project directory before launchingapp.py.
app.py, requirements.txt, and your trained model checkpoint (autoencoder_mvtec.pth) to the Space repository.This project is open-source and available under the MIT License.