Spaces:
Runtime error
Runtime error
work???
Browse files
routes/aminoOSRapi/main.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import requests
|
| 2 |
import pytesseract
|
|
|
|
| 3 |
from PIL import Image, ImageEnhance
|
| 4 |
|
| 5 |
def apipredict(request):
|
|
@@ -20,7 +21,8 @@ def apipredict(request):
|
|
| 20 |
if pix[x, y] == forReplace:
|
| 21 |
image.putpixel((x, y), newColor)
|
| 22 |
|
| 23 |
-
|
|
|
|
| 24 |
|
| 25 |
pix = image.load()
|
| 26 |
|
|
|
|
| 1 |
import requests
|
| 2 |
import pytesseract
|
| 3 |
+
from io import BytesIO
|
| 4 |
from PIL import Image, ImageEnhance
|
| 5 |
|
| 6 |
def apipredict(request):
|
|
|
|
| 21 |
if pix[x, y] == forReplace:
|
| 22 |
image.putpixel((x, y), newColor)
|
| 23 |
|
| 24 |
+
response = requests.get(url, stream=True)
|
| 25 |
+
image = Image.open(BytesIO(response.content))
|
| 26 |
|
| 27 |
pix = image.load()
|
| 28 |
|