This repository contains code for detecting and analyzing dark patterns (NLP + Vision). Large datasets and model weights are excluded from the repository and should be stored externally or tracked with Git LFS.
Included (what to commit)
- All source code:
app.py,Vision_/,NLP_/(scripts, training and prediction code) requirements.txtandweb_requirements.txttemplates/andstatic/(web UI files)- Notebooks for demonstration and experiments
Excluded (what NOT to commit)
- Virtual environment:
dp_env/,venv/,.venv/ - Datasets:
NLP_Dataset/,Vision_Dataset/ - Training outputs and model artifacts:
model_out/,outputs/,runs/,*.pt,*.safetensors
Push instructions (example)
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/baby-rex/Dark_Pattern.git
git push -u origin mainIf you have large model files you want to keep in the repo, use Git LFS:
brew install git-lfs # macOS
git lfs install
git lfs track "*.pt"
git lfs track "*.safetensors"
git add .gitattributes
git add .
git commit -m "Track large model files with Git LFS"
git push origin mainHigh-level layout
-
Root files
app.py— Flask/FastAPI (web) entrypoint for serving UI and APIs.web_requirements.txt— dependencies for the web service.yolov8m.pt— (large) object-detection weight (keep out of repo or use Git LFS).
-
Web UI
templates/— HTML templates for server-rendered pages.static/— CSS, JS, and static assets (style.css).
-
NLP module (
NLP_/)train_model.py— training script for NLP models.predict.py— inference/prediction utilities.requirements.txt— module-specific dependencies.misc.ipynb— exploratory notebook.
-
Vision module (
Vision_/)train_model.py— training script for vision models.prediction.py— inference utilities for images.xai_test_out/— explainability outputs and visualizations (generated).
-
Datasets (excluded from repo)
NLP_Dataset/— raw/processed NLP datasets (large; keep externally).Vision_Dataset/— image dataset, labels, and splits (large).
-
Model artifacts & checkpoints (excluded)
model_out/— saved model weights, checkpoints, scheduler/optimizer states.runs/,outputs/— training logs, tensorboard data, evaluation outputs.
-
Environment & tools
dp_env/— local Python virtual environment (do not commit).requirements.txt,web_requirements.txt— top-level dependency lists.
Typical workflows
- Development: edit source under
NLP_/andVision_/, run unit or integration checks locally using thedp_envvirtualenv. - Training: run
train_model.pyin the appropriate module; outputs and checkpoints write tomodel_out/andruns/(ignored). - Inference / Serving:
app.pyloads model artifacts (prefer loading from external storage) and serves predictions usingtemplates/+static/.
Recommended files to commit
- All source code and small helper scripts:
app.py,Vision_/,NLP_/(code only — not large artifacts). templates/andstatic/(web UI assets).requirements.txtandweb_requirements.txt.README.mdand minimalmanifest.txt(optional) listing external datasets and model locations.
Files to exclude from Git (already in .gitignore)
dp_env/,NLP_Dataset/,Vision_Dataset/,model_out/,runs/,outputs/, large weights like*.pt/*.safetensors.
Large files strategy
- Use Git LFS for model weights you must track (
*.pt,*.safetensors). - Store datasets and heavy checkpoints in cloud storage (S3, Google Drive, or an artifact store) and provide download scripts.
Notes
- Before pushing, verify
.gitignoreexcludes the large folders listed above. - If you accidentally committed large files, use
git rm --cached <file>and considerbfgorgit filter-repoto remove them from history.