Instructions to use litert-community/inception_v3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use litert-community/inception_v3 with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
fix_inception_v3
#2
by sourcelite - opened
README.md
CHANGED
|
@@ -73,7 +73,10 @@ def preprocess(img: Image.Image) -> np.ndarray:
|
|
| 73 |
x = (x - np.array([0.485, 0.456, 0.406], dtype=np.float32)) / np.array(
|
| 74 |
[0.229, 0.224, 0.225], dtype=np.float32
|
| 75 |
)
|
| 76 |
-
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
def main():
|
| 79 |
ap = argparse.ArgumentParser()
|
|
|
|
| 73 |
x = (x - np.array([0.485, 0.456, 0.406], dtype=np.float32)) / np.array(
|
| 74 |
[0.229, 0.224, 0.225], dtype=np.float32
|
| 75 |
)
|
| 76 |
+
# Expand dimensions to create NHWC 4D tensor: (1, 299, 299, 3)
|
| 77 |
+
x = np.expand_dims(x, axis=0)
|
| 78 |
+
|
| 79 |
+
return x
|
| 80 |
|
| 81 |
def main():
|
| 82 |
ap = argparse.ArgumentParser()
|