huseinzol05
commited on
Commit
•
bd5f7ca
1
Parent(s):
dabd2b1
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
task_categories:
|
3 |
+
- image-feature-extraction
|
4 |
+
---
|
5 |
+
|
6 |
+
# Google Image Malaysia Location Embedding
|
7 |
+
|
8 |
+
Original dataset https://huggingface.co/datasets/malaysia-ai/crawl-google-image-malaysia-location, we convert to embedding using https://huggingface.co/google/siglip-base-patch16-512
|
9 |
+
|
10 |
+
Source code at https://github.com/mesolitica/malaysian-dataset/tree/master/vlm/dedup-malaysia-location
|
11 |
+
|
12 |
+
## how-to
|
13 |
+
|
14 |
+
We use MosaicML for faster indexing,
|
15 |
+
|
16 |
+
```python
|
17 |
+
from streaming import MDSWriter
|
18 |
+
from streaming.base.format.mds.encodings import Encoding, _encodings
|
19 |
+
from streaming import LocalDataset
|
20 |
+
import streaming
|
21 |
+
import numpy as np
|
22 |
+
from tqdm import tqdm
|
23 |
+
|
24 |
+
class Float32(Encoding):
|
25 |
+
def encode(self, obj) -> bytes:
|
26 |
+
return obj.tobytes()
|
27 |
+
|
28 |
+
def decode(self, data: bytes):
|
29 |
+
return np.frombuffer(data, np.float32)
|
30 |
+
|
31 |
+
_encodings['float32'] = Float32
|
32 |
+
|
33 |
+
dataset = LocalDataset('google-image-malaysia-location-embedding')
|
34 |
+
```
|