Update README.md
Browse files
README.md
CHANGED
@@ -7,7 +7,17 @@ pipeline_tag: image-feature-extraction
|
|
7 |
|
8 |
A simple, small-ish network for producing embeddings for black and white binary images. Takes a 32x32 drawing a produces a 64-dimensional embedding.
|
9 |
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
```
|
13 |
import onnxruntime as ort
|
@@ -23,4 +33,16 @@ def compare(input_img_a, input_img_b):
|
|
23 |
b_embedding = ort_sess.run(None, {'input': img_b.astype(numpy.float32)})[0]
|
24 |
|
25 |
sim = numpy.dot(a_embedding , b_embedding.T) # Or a_embedding @ b_embedding.T
|
26 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
A simple, small-ish network for producing embeddings for black and white binary images. Takes a 32x32 drawing a produces a 64-dimensional embedding.
|
9 |
|
10 |
+
You can see this in action on https://huggingface.co/spaces/JosephCatrambone/tiny_doodle_embedding
|
11 |
+
|
12 |
+
## Input Format:
|
13 |
+
|
14 |
+
The model expects a (b, 32, 32) float32 input, generally with 0.0 being "background" and 1.0 being "foreground", similar to MNIST.
|
15 |
+
The model is trained with QuickDraw data, and image data being justified to the top-left corner (0,0), so when using the model take steps to align images to the top-left.
|
16 |
+
|
17 |
+
## Output:
|
18 |
+
Given a batch of (b, 32, 32), the model will produce a normalized (b, 64) matrix of floats.
|
19 |
+
|
20 |
+
## Sample usage:
|
21 |
|
22 |
```
|
23 |
import onnxruntime as ort
|
|
|
33 |
b_embedding = ort_sess.run(None, {'input': img_b.astype(numpy.float32)})[0]
|
34 |
|
35 |
sim = numpy.dot(a_embedding , b_embedding.T) # Or a_embedding @ b_embedding.T
|
36 |
+
```
|
37 |
+
|
38 |
+
## Training Details:
|
39 |
+
|
40 |
+
This model was trained on images taken from the Google QuickDraw dataset, rasterized to 32x32 binary images. Augmentations were basic, consisting of noise and an occasional dilation.
|
41 |
+
|
42 |
+
The model was trained for 100 epochs on a consumer-grade nVidia 3090.
|
43 |
+
|
44 |
+
Details of the run are visible at https://wandb.ai/josephc/tiny_doodle_model/runs/7wqz4w7g?nw=nwuserjosephc
|
45 |
+
|
46 |
+
## Power Use and Environmental Considerations:
|
47 |
+
|
48 |
+
The model consumed 120W for a duration of 570 seconds for training the final version. Excess heat from the training process was used to heat the home of the author in place of gas heating.
|