Spaces:
Sleeping
Sleeping
Download debug.py from HoagMin/FoodDetection: direct link, hf CLI and curl.
- Browser
- Download file 431 Bytes
-
https://huggingface.co/spaces/HoagMin/FoodDetection/resolve/main/debug.py
- Command line
-
hf download hf://spaces/HoagMin/FoodDetection/debug.py
-
curl -L -o debug.py https://huggingface.co/spaces/HoagMin/FoodDetection/resolve/main/debug.py
431 Bytes
| # Initialize PaddleOCR instance | |
| from paddleocr import PaddleOCR | |
| ocr = PaddleOCR( | |
| use_doc_orientation_classify=False, | |
| use_doc_unwarping=False, | |
| use_textline_orientation=False) | |
| # Run OCR inference on a sample image | |
| result = ocr.predict( | |
| input="static/debug/phobo.png",) | |
| # Visualize the results and save the JSON results | |
| for res in result: | |
| res.print() | |
| res.save_to_img("output") | |
| res.save_to_json("output") |