mlboydaisuke commited on
Commit
5b628c6
Β·
verified Β·
1 Parent(s): bb1dddd

Places365 ResNet18 LiteRT fp16 (fully-GPU, Pixel 8a corr 1.0, 2ms)

Browse files
Files changed (4) hide show
  1. .gitattributes +1 -0
  2. README.md +47 -0
  3. places_fp16.tflite +3 -0
  4. samples/sample.png +3 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ samples/sample.png filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: LiteRT
4
+ pipeline_tag: image-classification
5
+ tags: [litert, tflite, on-device, android, gpu, scene-recognition, places365, resnet]
6
+ base_model: CSAILVision/places365
7
+ ---
8
+
9
+ # Places365 ResNet18 β€” LiteRT (on-device scene recognition, fully-GPU)
10
+
11
+ ResNet18 trained on [Places365](http://places2.csail.mit.edu/) (CSAILVision), converted to **LiteRT** and
12
+ running **fully on the `CompiledModel` GPU** (ML Drift) on Android. **Scene/place recognition** across **365
13
+ categories** (beach, kitchen, forest, office, restaurant, …) β€” a distinct task from object classification.
14
+
15
+ ![Places365 β€” image | top-5 scenes (on-device LiteRT GPU)](samples/sample.png)
16
+
17
+ ## On-device (Pixel 8a, Tensor G3 β€” verified)
18
+
19
+ | | |
20
+ |---|---|
21
+ | nodes on GPU | **61 / 61** LITERT_CL (full residency) |
22
+ | inference | **~2 ms** (224Γ—224) |
23
+ | size | 22.8 MB (fp16) |
24
+ | accuracy | device-vs-PyTorch corr **1.0**, top-1 match |
25
+
26
+ ```
27
+ image[1,3,224,224] (ImageNet-normalized) β†’[GPU: ResNet18]β†’ logits[1,365]
28
+ ```
29
+
30
+ ## How it converts (litert-torch) β€” two numerically-exact re-authorings
31
+
32
+ 1. global `AdaptiveAvgPool2d(1)` β†’ `mean(3).mean(2)` (multi-axis-pool fix).
33
+ 2. **ResNet stem `MaxPool2d(3,s2,p1)` β†’ zero-pad + valid max-pool.** PyTorch's max-pool pads with `-inf` β†’
34
+ a `PADV2` op the Mali delegate won't delegate (splits the graph β†’ compile fail). Since the pool follows a
35
+ ReLU (inputs β‰₯ 0), a **0-pad is exactly equivalent** and emits a delegatable `PAD` β†’ full GPU residency.
36
+
37
+ Result: banned ops NONE, all tensors ≀4D, tflite-vs-torch corr **1.0**, device-vs-torch corr **1.0**.
38
+
39
+ ## Preprocessing
40
+
41
+ Center-crop to square, resize to 224Γ—224, /255, ImageNet mean/std, NCHW. Output 365-class scene logits;
42
+ softmax + argmax for top-k.
43
+
44
+ ## License
45
+
46
+ [MIT](https://github.com/CSAILVision/places365/blob/master/LICENSE). Upstream:
47
+ [CSAILVision/places365](https://github.com/CSAILVision/places365).
places_fp16.tflite ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8eb6c7ee5ec21be435d6d11f24bd68e13199bb457ff4c01fb07bde213f289d39
3
+ size 22775088
samples/sample.png ADDED

Git LFS Details

  • SHA256: 2d1f04e3b36d37fd84f8839e873fa3bb8a4b76a5af9546c8113a907285a98d56
  • Pointer size: 131 Bytes
  • Size of remote file: 173 kB