Spaces:
Runtime error
Runtime error
Download test.py from SoccerQ/video-analysis: direct link, hf CLI and curl.
- Browser
- Download file 853 Bytes
-
https://huggingface.co/spaces/SoccerQ/video-analysis/resolve/main/test.py
- Command line
-
hf download hf://spaces/SoccerQ/video-analysis/test.py
-
curl -L -o test.py https://huggingface.co/spaces/SoccerQ/video-analysis/resolve/main/test.py
853 Bytes
| import uuid | |
| import cv2 | |
| from super_image import EdsrModel, ImageLoader | |
| from PIL import Image | |
| from visionAPICall import visionAPIGetDigits | |
| INPUT = './a_tiny_input_image2.png' | |
| original_image = cv2.imread(INPUT) | |
| digits = visionAPIGetDigits(original_image, draw_bbox=True, only_draw_if_exists=True, display=True) | |
| print(f"digits = {digits}") | |
| # SCALING_FACTOR = 4 | |
| # random_id = uuid.uuid1() | |
| # OUTPUT = f'./prepareImagesForVision/scaled_{SCALING_FACTOR}x_id_{random_id}.png' | |
| # image = Image.open(INPUT) | |
| # model = EdsrModel.from_pretrained('eugenesiow/edsr-base', scale=SCALING_FACTOR) | |
| # inputs = ImageLoader.load_image(image) | |
| # preds = model(inputs) | |
| # ImageLoader.save_image(preds, OUTPUT) | |
| # large_image = cv2.imread(OUTPUT) | |
| # digits = visionAPIGetDigits(large_image, draw_bbox=True, only_draw_if_exists=True, display=True) | |
| # print(f"digits = {digits}") |