ZipPlus / README.md
CompactAI's picture
Update README.md
010f6f2 verified
|
raw
history blame
2.21 kB
---
license: mit
---
# ZipPlus2048 Model Card
**A pre-trained 2-layer GRU model for neural file compression. Compress any file into a PNG image using a neural network and extract it back.**
This is a pre-trained ByteGRU model for [Zip+](https://github.com/CompactAIOfficial/ZipPlus) - use this instead of training your own.
## What is this
This model compresses any file into a PNG image using a neural network (GRU + range coding) and extracts it back. The compressed files look like weird colorful static - perfect for confusing anyone who peeks at your folder.
```
file.txt β†’ [ByteGRU + Range Coding] β†’ file.txt.zpng.png β†’ [ByteGRU + Range Coding] β†’ file.txt
```
**The PNG contains a special `ZPNG` magic header**, so random images won't decompress. Your cat photos are safe. Mostly.
## Model Details
- **Architecture**: 2-layer GRU over byte embeddings
- **Embedding dim**: 64 β†’ Hidden dim: 256
- **Trained on**: A variety of file types
- **Entropy coding**: Range coding via Constriction
- **Output format**: PNG where payload lives in RGB pixel bytes
- **Magic header**: `ZPNG` (first 4 bytes)
-
## Requirements
- Python 3.10+
- PyTorch
- Constriction (`pip install constriction`)
- Pillow
- numpy
```bash
pip install torch constriction pillow numpy
```
## Quick Start
### Compress a file
```bash
python inference.py compress myfile.txt -o myfile.zpng.png -m model.pt
```
### Decompress
```bash
python inference.py decompress myfile.zpng.png -o restored.txt -m model.pt
```
Done. Your file is back. Hopefully.
## Interactive Menu
Just run `python compressor.py -m model.pt` for the menu. It's vaguely intuitive if you squint.
## Performance
Compression ratio varies. Text files compress okay. Binary files? Less okay. Random data? It might actually grow. That's the fun part.
## Warnings
- **Don't lose this model**. Without the model file, your `.zpng.png` files are colorful but useless.
- **Lossiness is possible**. If the compression produces artifacts, restored files may differ. Check with checksums.
- **GPU recommended**. CPU inference is tolerable.
-
## License
MIT. I'm not liable if this eats your thesis/pixels/anything.
---
Use it because it's amusing. Or don't