A deep learning-based system for detecting and localizing Code128 finder patterns from normalized 1D signals.
The project includes:
- 📦 Dataset loading and preprocessing
- 🧠 Model definition and training (PyTorch)
- 🔍 Evaluation and plotting tools
- 🛠️ CLI scripts for training, prediction, and processing
git clone https://github.com/aidinattar/code128-net.git
cd code128-net
make requirements
You can also create a virtual environment with
make create_environment
if you use Conda.
Train a model:
make train
Run inference on test data:
make predict
Evaluate results and generate plots:
make evaluate
Run all tests:
make test
code128-net/
├── data/ # Raw, processed and interim datasets
├── models/ # Trained model weights
├── reports/ # Output plots and evaluation results
├── code128net/ # Main source code
│ ├── config.py
│ ├── dataset.py
│ ├── features.py
│ ├── plots.py
│ ├── evaluation.py
│ └── modeling/
│ ├── model.py
│ ├── train.py
│ └── predict.py
├── tests/ # Unit tests with pytest
├── requirements.txt
├── Makefile
└── README.md
The model predicts 4 outputs for each signal:
class
: the type of finder pattern (StartA
,StartB
,StartC
,Stop
,NoPattern
)index
: the starting index of the patternppe
: the pattern's proportional position estimatedirection
: the direction (0 or 1)
Unit tests are implemented using pytest
:
pytest tests/
Tests cover:
- Model architecture and forward pass
- Dataset and data loading
- Loss computation and training loop
- CLI scripts (via
typer.testing.CliRunner
)
This project is open-source and available under the MIT License.
Created by Aidin Attar for a deep learning assignment on 1D signal analysis using PyTorch.