Instructions to use litert-community/resnet18 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use litert-community/resnet18 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
Updated README.md
#2
by akashvverma1995 - opened
README.md
CHANGED
|
@@ -9,7 +9,7 @@ tags:
|
|
| 9 |
datasets:
|
| 10 |
- imagenet-1k
|
| 11 |
model-index:
|
| 12 |
-
- name:
|
| 13 |
results:
|
| 14 |
- task:
|
| 15 |
type: image-classification
|
|
@@ -52,7 +52,17 @@ num_params: 11,689,512
|
|
| 52 |
|
| 53 |
The model files were converted from pretrained weights from PyTorch Vision. The models may have their own licenses or terms and conditions derived from PyTorch Vision and the dataset used for training. It is your responsibility to determine whether you have permission to use the models for your use case.
|
| 54 |
|
| 55 |
-
## Use
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
```python
|
| 58 |
#!/usr/bin/env python3
|
|
@@ -113,6 +123,13 @@ def main():
|
|
| 113 |
if __name__ == "__main__":
|
| 114 |
main()
|
| 115 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
### BibTeX entry and citation info
|
| 117 |
|
| 118 |
```bibtex
|
|
|
|
| 9 |
datasets:
|
| 10 |
- imagenet-1k
|
| 11 |
model-index:
|
| 12 |
+
- name: litert-community/resnet18
|
| 13 |
results:
|
| 14 |
- task:
|
| 15 |
type: image-classification
|
|
|
|
| 52 |
|
| 53 |
The model files were converted from pretrained weights from PyTorch Vision. The models may have their own licenses or terms and conditions derived from PyTorch Vision and the dataset used for training. It is your responsibility to determine whether you have permission to use the models for your use case.
|
| 54 |
|
| 55 |
+
## How to Use
|
| 56 |
+
|
| 57 |
+
**1. Install Dependencies** Ensure your Python environment is set up with the required libraries. Run the following command in your terminal:
|
| 58 |
+
|
| 59 |
+
```bash
|
| 60 |
+
pip install numpy Pillow huggingface_hub ai-edge-litert
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
**2. Prepare Your Image** The script expects an image file to analyze. Make sure you have an image (e.g., cat.jpg or car.png) saved in the same working directory as your script.
|
| 64 |
+
|
| 65 |
+
**3. Save the Script** Create a new file named `classify.py`, paste the script below into it, and save the file:
|
| 66 |
|
| 67 |
```python
|
| 68 |
#!/usr/bin/env python3
|
|
|
|
| 123 |
if __name__ == "__main__":
|
| 124 |
main()
|
| 125 |
```
|
| 126 |
+
|
| 127 |
+
**4. Execute the Python Script** Run the below command:
|
| 128 |
+
|
| 129 |
+
```bash
|
| 130 |
+
python classify.py --image cat.jpg
|
| 131 |
+
```
|
| 132 |
+
|
| 133 |
### BibTeX entry and citation info
|
| 134 |
|
| 135 |
```bibtex
|