Skip to content

baby-rex/Dark_Pattern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dark_Pattern (Asian heart)

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.txt and web_requirements.txt
  • templates/ and static/ (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 main

If 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 main

Architecture

High-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_/ and Vision_/, run unit or integration checks locally using the dp_env virtualenv.
  • Training: run train_model.py in the appropriate module; outputs and checkpoints write to model_out/ and runs/ (ignored).
  • Inference / Serving: app.py loads model artifacts (prefer loading from external storage) and serves predictions using templates/ + static/.

Recommended files to commit

  • All source code and small helper scripts: app.py, Vision_/, NLP_/ (code only — not large artifacts).
  • templates/ and static/ (web UI assets).
  • requirements.txt and web_requirements.txt.
  • README.md and minimal manifest.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 .gitignore excludes the large folders listed above.
  • If you accidentally committed large files, use git rm --cached <file> and consider bfg or git filter-repo to remove them from history.

About

An AI-driven system for detecting dark patterns in user interfaces, enhanced with explainability to clearly interpret why a pattern is flagged. Designed to improve transparency, trust, and ethical design in digital products.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors