Update README.md
Browse files
README.md
CHANGED
|
@@ -17,113 +17,125 @@ pretty_name: mtg card SIFT Feature dataset
|
|
| 17 |
size_categories:
|
| 18 |
- 100K<n<1M
|
| 19 |
tags:
|
| 20 |
-
- v5.
|
| 21 |
---
|
| 22 |
|
| 23 |
-
# MTG Card SIFT Features Dataset (v5)
|
| 24 |
|
| 25 |

|
| 26 |
|
| 27 |
-
This dataset contains the latest
|
| 28 |
|
| 29 |
-
> **Note:**
|
| 30 |
|
| 31 |
---
|
| 32 |
|
| 33 |
-
## What’s New in v5?
|
| 34 |
|
| 35 |
-
| Feature |
|
| 36 |
-
| -------------------- | ----------------------
|
| 37 |
-
| Index
|
| 38 |
-
|
|
| 39 |
-
|
|
| 40 |
-
|
|
| 41 |
-
|
|
| 42 |
|
| 43 |
---
|
| 44 |
|
| 45 |
-
## File Layout (
|
| 46 |
|
| 47 |
```
|
| 48 |
resources/
|
| 49 |
└── run/
|
| 50 |
-
├── candidate_features.h5 #
|
| 51 |
-
├── faiss_ivf.index # FAISS IVF-PQ index
|
| 52 |
-
└── id_map.json #
|
| 53 |
```
|
| 54 |
|
| 55 |
-
|
| 56 |
---
|
| 57 |
|
| 58 |
## What Is This?
|
| 59 |
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
-
##
|
| 63 |
|
| 64 |
1. **Image Acquisition**
|
| 65 |
|
| 66 |
-
*
|
| 67 |
2. **Preprocessing**
|
| 68 |
|
| 69 |
-
*
|
| 70 |
-
3. **
|
| 71 |
|
| 72 |
-
*
|
| 73 |
-
4. **
|
| 74 |
|
| 75 |
-
*
|
| 76 |
5. **Indexing**
|
| 77 |
|
| 78 |
-
*
|
| 79 |
-
* Index grows over time as new cards are processed.
|
| 80 |
6. **Mapping**
|
| 81 |
|
| 82 |
-
*
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
---
|
| 85 |
|
| 86 |
-
##
|
| 87 |
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
|
| 93 |
---
|
| 94 |
|
| 95 |
-
##
|
| 96 |
|
| 97 |
```text
|
| 98 |
-
[Input
|
| 99 |
-
|
| 100 |
-
[CLAHE
|
| 101 |
-
|
| 102 |
[FAISS IVF-PQ Search]
|
| 103 |
-
|
| 104 |
-
[
|
| 105 |
-
|
| 106 |
-
[
|
| 107 |
```
|
| 108 |
|
| 109 |
---
|
| 110 |
|
| 111 |
-
##
|
| 112 |
|
| 113 |
-
✅ No SQLite
|
| 114 |
-
✅ Works
|
| 115 |
-
✅
|
| 116 |
-
✅
|
| 117 |
-
✅ MIT Licensed
|
| 118 |
|
| 119 |
---
|
| 120 |
|
| 121 |
## Acknowledgments
|
| 122 |
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
|
| 127 |
---
|
| 128 |
|
| 129 |
-
For
|
|
|
|
| 17 |
size_categories:
|
| 18 |
- 100K<n<1M
|
| 19 |
tags:
|
| 20 |
+
- v5.1
|
| 21 |
---
|
| 22 |
|
| 23 |
+
# MTG Card SIFT Features Dataset (v5.1)
|
| 24 |
|
| 25 |

|
| 26 |
|
| 27 |
+
This dataset contains the **latest incremental MTG card SIFT + RootSIFT feature extraction pipeline**. It is designed for **server-side production inference**, enabling **additive updates to the FAISS index and `id_map.json`** without retraining or reindexing from scratch.
|
| 28 |
|
| 29 |
+
> **Note:** This version aligns with a daily `resources-nightly.zip` Hugging Face upload workflow for reliable continuous deployment via my production server.
|
| 30 |
|
| 31 |
---
|
| 32 |
|
| 33 |
+
## What’s New in v5.1?
|
| 34 |
|
| 35 |
+
| Feature | v5.0 | v5.1 (Current) |
|
| 36 |
+
| -------------------- | -------------------------- | ----------------------------------- |
|
| 37 |
+
| Index updates | Additive-safe | Same |
|
| 38 |
+
| Upload workflow | Manual or ad-hoc | Integrated with HF nightly pipeline |
|
| 39 |
+
| Logging | Basic | Detailed zipping and upload logs |
|
| 40 |
+
| Service impact | Potential blocking uploads | Runs in background, non-blocking |
|
| 41 |
+
| HF dataset structure | Single zip upload | Same, consistent naming |
|
| 42 |
|
| 43 |
---
|
| 44 |
|
| 45 |
+
## File Layout (`resources-nightly.zip`)
|
| 46 |
|
| 47 |
```
|
| 48 |
resources/
|
| 49 |
└── run/
|
| 50 |
+
├── candidate_features.h5 # Keypoints + descriptors per card (gzip HDF5)
|
| 51 |
+
├── faiss_ivf.index # FAISS IVF-PQ index
|
| 52 |
+
└── id_map.json # Descriptor index-to-scryfall_id mapping
|
| 53 |
```
|
| 54 |
|
|
|
|
| 55 |
---
|
| 56 |
|
| 57 |
## What Is This?
|
| 58 |
|
| 59 |
+
A **high-precision visual descriptor dataset** for Magic: The Gathering cards, used for:
|
| 60 |
+
|
| 61 |
+
✅ **Visual Search**
|
| 62 |
+
✅ **Mobile/Server Card Scanning**
|
| 63 |
+
✅ **FAISS-based Similarity Search**
|
| 64 |
+
✅ **Incremental Model Growth**
|
| 65 |
+
|
| 66 |
+
---
|
| 67 |
|
| 68 |
+
## Pipeline Summary
|
| 69 |
|
| 70 |
1. **Image Acquisition**
|
| 71 |
|
| 72 |
+
* Fetched from Scryfall using official API.
|
| 73 |
2. **Preprocessing**
|
| 74 |
|
| 75 |
+
* Resize with aspect ratio, CLAHE on L-channel, grayscale conversion.
|
| 76 |
+
3. **Feature Extraction**
|
| 77 |
|
| 78 |
+
* OpenCV SIFT + RootSIFT normalization.
|
| 79 |
+
4. **Storage**
|
| 80 |
|
| 81 |
+
* `candidate_features.h5` using gzip compression.
|
| 82 |
5. **Indexing**
|
| 83 |
|
| 84 |
+
* FAISS IVF-PQ (100 clusters, 8x8 PQ), additive updates supported.
|
|
|
|
| 85 |
6. **Mapping**
|
| 86 |
|
| 87 |
+
* `id_map.json` aligns descriptors to `scryfall_id`.
|
| 88 |
+
7. **HF Upload**
|
| 89 |
+
|
| 90 |
+
* Zipped nightly, uploaded to HF dataset repo in the background.
|
| 91 |
|
| 92 |
---
|
| 93 |
|
| 94 |
+
## Use Cases
|
| 95 |
|
| 96 |
+
✅ **Real-time card scanning** for Magic: The Gathering
|
| 97 |
+
✅ **Card image search pipelines**
|
| 98 |
+
✅ **Local inference on low-resource servers**
|
| 99 |
+
✅ **Model growth without reindexing**
|
| 100 |
|
| 101 |
---
|
| 102 |
|
| 103 |
+
## Workflow (Simplified)
|
| 104 |
|
| 105 |
```text
|
| 106 |
+
[Input Image]
|
| 107 |
+
↓
|
| 108 |
+
[CLAHE + SIFT + RootSIFT]
|
| 109 |
+
↓
|
| 110 |
[FAISS IVF-PQ Search]
|
| 111 |
+
↓
|
| 112 |
+
[Retrieve scryfall_id]
|
| 113 |
+
↓
|
| 114 |
+
[Result]
|
| 115 |
```
|
| 116 |
|
| 117 |
---
|
| 118 |
|
| 119 |
+
## Why v5.1 Matters
|
| 120 |
|
| 121 |
+
✅ **No SQLite required**
|
| 122 |
+
✅ **Works with h5py + NumPy**
|
| 123 |
+
✅ **Parallel-safe and resumable**
|
| 124 |
+
✅ **Tiny memory footprint**
|
| 125 |
+
✅ **MIT Licensed for free, unlimited use**
|
| 126 |
|
| 127 |
---
|
| 128 |
|
| 129 |
## Acknowledgments
|
| 130 |
|
| 131 |
+
Created by [JakeTurner616](https://github.com/JakeTurner616)
|
| 132 |
+
Powered by:
|
| 133 |
+
|
| 134 |
+
* [Scryfall API](https://scryfall.com/docs/api)
|
| 135 |
+
* [FAISS](https://github.com/facebookresearch/faiss)
|
| 136 |
+
* [OpenCV](https://opencv.org/)
|
| 137 |
+
* [h5py](https://www.h5py.org/)
|
| 138 |
|
| 139 |
---
|
| 140 |
|
| 141 |
+
For deep implementation details, see the [mtgscan.cards monorepo](https://github.com/mtgscan-cards/monolithic).
|