# ODDGen

A Python pipeline that cuts objects out of photos, places them on backgrounds and writes each bounding box in the same step, in large batches.

- Web page: https://pranavsastry.com/projects/oddgen
- Kind: Project
- Headline: I wrote a generator that labels its own **detection data**.
- Stack: Python, PyTorch
- Status: Public repository
- Year: 2023

## How it works

A background remover (U²-Net or ISNet) cuts each object out of its photo, and a training script is included for a custom remover. The objects are placed on background images, and every placement writes its annotation in the same step.

**Figure 1. One generated training image.** A schematic of ODDGen’s pipeline, which generates in batches; its example uses ShapeNet objects.

What the animated figure shows: A background remover cuts an object out of its photo, the object is placed on a background, and its bounding box is written in the same step.

## How it scales

It generates in batches, so a dataset of tens of thousands of images is a matter of configuration. The repository’s example uses three ShapeNet objects: a phone, a ship and a plane.

## Where it came from

Detection work like my [waste-segregation paper](https://pranavsastry.com/papers/performance-analysis-of-object-detection-algorithms-for-waste-segregation.md) depends on labeled images. ODDGen came after that paper, as a separate project.

## Links

- GitHub: [https://github.com/pranftw/oddgen](https://github.com/pranftw/oddgen)

## More projects

- [AutoPilot](https://pranavsastry.com/projects/autopilot.md) optimizes prompts, rules and agents the way PyTorch trains a model, and **rolls back** a change that does not hold up.
- [Aiter](https://pranavsastry.com/projects/aiter.md) is a terminal AI agent I wrote so I could change its **tools**, MCP servers and saved sessions.
- [RecLLM](https://pranavsastry.com/projects/recllm.md) is a prototype for **shopping by conversation**: an index of a store’s catalog, and a memory of what each shopper likes.
- [Neograd](https://pranavsastry.com/projects/neograd.md) is a deep-learning framework I wrote from scratch in Python and NumPy, to see **how autograd works**.
- [OpenReview Scraper](https://pranavsastry.com/projects/openreview-scraper.md) turns conference submissions into a **reading list** by searching their titles, abstracts and keywords.
- [rapidx](https://pranavsastry.com/projects/rapidx.md) runs experiments from many research codebases through one entry point, each in its **own environment**.
- [All projects](https://pranavsastry.com/projects.md)
- [Home and directory](https://pranavsastry.com/index.md)
