sarpreetsingh3131 commited on
Commit
32e212e
·
verified ·
1 Parent(s): f9b7aeb

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -7
README.md CHANGED
@@ -79,17 +79,13 @@ python digit-recognition/inference.py my-digit.png
79
  my-digit.png: ੨ 0.99, ੩ 0.01, ੭ 0.00
80
  ```
81
 
82
- **From Python**
83
 
84
  ```python
85
- import sys
86
- from huggingface_hub import snapshot_download
87
-
88
- sys.path.insert(0, snapshot_download("aipanjab/digit-recognition"))
89
  from inference import DigitRecognizer
90
 
91
- recognizer = DigitRecognizer()
92
- print(recognizer.predict("my-digit.png")) # {'੨': 0.99, '੩': 0.01, '੭': 0.0}
93
  ```
94
 
95
  `predict` takes a file path, an open file or a PIL image, and `top_k` (default 3). A picture with nothing drawn on it
 
79
  my-digit.png: ੨ 0.99, ੩ 0.01, ੭ 0.00
80
  ```
81
 
82
+ **From Python**, inside the downloaded folder:
83
 
84
  ```python
 
 
 
 
85
  from inference import DigitRecognizer
86
 
87
+ recognizer = DigitRecognizer() # device="auto": an NVIDIA GPU if onnxruntime-gpu finds one, else the CPU
88
+ print(recognizer.predict("my-digit.png")) # {'੨': 0.99, '੩': 0.01, '੭': 0.0}
89
  ```
90
 
91
  `predict` takes a file path, an open file or a PIL image, and `top_k` (default 3). A picture with nothing drawn on it