How aditya-bachhav/adi-codec works
1. What this repository is, in practice
- The checked-in code is a small Python image-encoding prototype centered around a single script, encoder.py.
- Although the README describes a larger “ADI v0.1” system with training, decoding, and a demo, the file tree here does not contain that full multi-module stack.
2. Main runtime boundary
- The only obvious executable entry point is encoder.py.
- This script appears to be responsible for taking an image from source_img/ and producing a compressed .adi artifact in outputs/.
3. Primary data flow
- Input images live in source_img/.
- The encoder processes them and writes binary output to outputs/, with outputs/ADI_IMG.adi serving as a sample result.
- That makes the repository mostly a one-way encode pipeline rather than a full codec system in this tree.
4. Artifacts and sample assets
- outputs/ADI_IMG.adi is the key generated artifact and is likely the format this repo is demonstrating.
- assets/ contains README imagery such as the hero graphic; these are documentation/marketing assets, not runtime dependencies.
- .vscode/ is editor configuration only and not part of the product architecture.
5. Dependency boundary
- requirenment.txt is the dependency manifest, but it is misspelled; that suggests a lightweight, manual Python setup rather than a packaged library/app.
- The runtime is therefore almost certainly local Python execution, not a service, daemon, or deployed backend.
6. Codec architecture implied by the README
- The README describes a more elaborate codec architecture: training a codebook, encoding images into tokenized instructions, and decoding .adi files back to images.
- In architectural terms, that implies three conceptual subsystems:
- Codebook/training: learn tokens from images
- Encoder: convert image blocks/features into .adi
- Decoder: reconstruct image from .adi
- However, only the encoder-side artifact is visible in this repo tree.
7. Likely missing subsystems relative to the README
- The README mentions downloader, trainer, codec, and a Gradio demo, but none of those folders/files appear in the tree.
- So for an accurate diagram, treat those as described-but-not-present components, or as future/aspirational modules rather than current implementation.
8. Format and storage boundary
- The .adi file is the repository’s core output format and serves as the persistence boundary between encoding and any later decoding step.
- The sample output in outputs/ indicates the format is intended to be portable and inspectable as a generated artifact.
9. No obvious external infrastructure
- There is no evidence here of databases, queues, cloud services, or web APIs.
- The architecture is therefore best drawn as a single-process local toolchain with file-based I/O.
10. How to diagram it
- Draw source_img/ as the input source, encoder.py as the central processing node, and outputs/*.adi as the emitted binary artifact.
- Show assets/ and the README as documentation/supporting material off to the side.
- If you include the broader README vision, mark training/codebook generation and decoding as conceptual modules not present in this checkout.
11. Overall architectural summary
- This repository is currently closest to a prototype image compressor/encoder with a file-based workflow.
- The core boundary is simple: image files in, .adi files out, implemented in Python, with the richer “codec platform” described in the README not fully reflected in the repository contents.
Main entry points: encoder.py encoder.py · source_img source_img · requirenment.txt requirenment.txt · outputs outputs
Components 7
Runtime
Local image encoding pipeline
- encoder.py · Main Python encoder script
encoder.py - source_img · Source images for encoding
source_img - outputs · Destination for generated .adi files
outputs - ADI_IMG.adi · Sample encoded ADI output
outputs/ADI_IMG.adi
Support
Docs, assets, and setup files
- Readme.md · Repository overview and codec vision
Readme.md - requirenment.txt · Python dependency list
requirenment.txt - assets · README imagery and supporting media
assets
Connections 4
- source_img → encoder.py: images in · Encoder reads source images from this folder
- encoder.py → outputs: writes · Encoded artifacts are emitted here
- encoder.py → ADI_IMG.adi: produces · Sample ADI file generated by the encoder
- requirenment.txt → encoder.py: deps · Python execution environment for the script