NeoNude

Version 1.0.0 Python 3.7+ PyTorch 1.7+ MIT License

GAN-based Image Transformation
A pix2pixHD architecture using a divide-et-impera approach for image transformation.


✨ Features

  • Auto Resize β€” Automatically resizes any input to 512x512 and restores original dimensions on output
  • 3-Phase GAN Pipeline β€” Clothing mask β†’ Anatomical detection β†’ Final generation
  • OpenCV Transforms β€” Color correction, mask refinement, and mask finalization
  • pix2pixHD Architecture β€” Global generator with residual blocks and instance normalization
  • Simple CLI β€” Easy input/output with minimal arguments

πŸ“‹ Requirements & Installation

Requirements

Component Requirement
Python 3.7 or higher
PyTorch 1.7 or higher
OpenCV 4.5+ (headless)
Pillow 8.0+
NumPy 1.19+

Installation

# Clone the repository
git clone https://github.com/fahimahamed1/NeoNude.git
cd NeoNude

# Install dependencies
pip install -r requirements.txt

Model Checkpoints

Place the model weight files in the checkpoints/ directory:

checkpoints/
β”œβ”€β”€ cm.lib    (~700 MB)
β”œβ”€β”€ mm.lib    (~700 MB)
└── mn.lib    (~700 MB)
πŸ“– How to Use

CLI

# Default: reads input.png, writes output.png
python main.py

# Custom input/output paths
python main.py -i photo.jpg -o result.png

# Help
python main.py --help
βš™οΈ Pipeline Architecture

Instead of a single network, the problem is split into 3 sub-problems:

  1. Mask generation β€” Identifies clothing regions
  2. Anatomical attribute detection β€” Produces an abstract body map
  3. Final image generation β€” Creates the output from the refined mask

Pipeline Phases

Phase Type Description
0 OpenCV Color correction and normalization
1 GAN Clothing mask generation (cm.lib)
2 OpenCV Mask refinement
3 GAN Anatomical detail detection (mm.lib)
4 OpenCV Mask finalization with body annotations
5 GAN Final image generation (mn.lib)
πŸ“‚ Project Structure
NeoNude/
β”œβ”€β”€ main.py                      # CLI entry point
β”œβ”€β”€ requirements.txt             # Python dependencies
β”œβ”€β”€ README.md
β”œβ”€β”€ src/                         # Core package
β”‚   β”œβ”€β”€ __init__.py              # Package metadata
β”‚   β”œβ”€β”€ config.py                # Pipeline configuration (Options)
β”‚   β”œβ”€β”€ pipeline.py              # Pipeline orchestrator (process function)
β”‚   β”œβ”€β”€ model.py                 # GAN model, dataset, utilities
β”‚   └── transforms/              # OpenCV image transforms
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ annotation.py        # Body part data class
β”‚       β”œβ”€β”€ correct.py           # Phase 0: color correction
β”‚       β”œβ”€β”€ maskref.py           # Phase 2: mask refinement
β”‚       └── maskfin.py           # Phase 4: mask finalization
└── checkpoints/                 # Model weight files (not tracked)

πŸ›‘οΈ Security Notes

⚠️ This tool is intended for:

  • Personal use and educational purposes
  • Research in GAN-based image transformation
  • Academic study of pix2pixHD architecture

Do NOT use for:

  • Generating non-consensual intimate imagery
  • Any form of harassment or exploitation
  • Any illegal activities

Always ensure proper authorization and ethical use before processing any images.


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘¨β€πŸ’» Author

Fahim Ahamed

GitHub


⭐ Support

If you find this project useful, please consider giving it a star! 🌟


Made with ❀️ for the open-source community

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support