Spaces:
Runtime error
Runtime error
CaesarCloudSync commited on
Commit ·
1f4f887
1
Parent(s): f0e26df
RevisionBank Notebook Laptop version at good point
Browse files- __pycache__/main.cpython-310.pyc +0 -0
- main.py +3 -2
- static/favicon.ico +0 -0
- templates/hello.html +3 -2
__pycache__/main.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/main.cpython-310.pyc and b/__pycache__/main.cpython-310.pyc differ
|
|
|
main.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
from fastapi import FastAPI, Request
|
| 2 |
-
from fastapi.responses import HTMLResponse,StreamingResponse
|
| 3 |
from fastapi.templating import Jinja2Templates
|
| 4 |
from fastapi.staticfiles import StaticFiles
|
| 5 |
from csv_to_db import ImportCSV
|
|
@@ -55,7 +55,8 @@ async def notecardimage(request: Request, h:str,u:str):
|
|
| 55 |
revisioncarddetected = found_revision_card[0]
|
| 56 |
imagecv2 = readb64(revisioncarddetected["revisioncardimage"][0])
|
| 57 |
res, im_png = cv2.imencode(".png", imagecv2)
|
| 58 |
-
return
|
|
|
|
| 59 |
except IndexError as iex:
|
| 60 |
print({"message":"revision card was not found or no image"})
|
| 61 |
|
|
|
|
| 1 |
from fastapi import FastAPI, Request
|
| 2 |
+
from fastapi.responses import HTMLResponse,StreamingResponse,Response
|
| 3 |
from fastapi.templating import Jinja2Templates
|
| 4 |
from fastapi.staticfiles import StaticFiles
|
| 5 |
from csv_to_db import ImportCSV
|
|
|
|
| 55 |
revisioncarddetected = found_revision_card[0]
|
| 56 |
imagecv2 = readb64(revisioncarddetected["revisioncardimage"][0])
|
| 57 |
res, im_png = cv2.imencode(".png", imagecv2)
|
| 58 |
+
return Response(content = im_png.tobytes(), media_type="image/png")
|
| 59 |
+
#return StreamingResponse(io.BytesIO(im_png.tobytes()), media_type="image/png")
|
| 60 |
except IndexError as iex:
|
| 61 |
print({"message":"revision card was not found or no image"})
|
| 62 |
|
static/favicon.ico
ADDED
|
|
templates/hello.html
CHANGED
|
@@ -5,6 +5,7 @@
|
|
| 5 |
|
| 6 |
<title>RevisionBank NoteCard</title>
|
| 7 |
<meta name="title" content="RevisionBank NoteCard"></meta>
|
|
|
|
| 8 |
<meta name="description" content="Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.">
|
| 9 |
</meta>
|
| 10 |
<meta property="og:type" content="website">
|
|
@@ -13,7 +14,7 @@
|
|
| 13 |
</meta>
|
| 14 |
<meta property="og:title" content="RevisionBank NoteCard">
|
| 15 |
</meta>
|
| 16 |
-
<meta property="og:description" content="
|
| 17 |
</meta>
|
| 18 |
<meta property="og:image" content="https://palondomus-revisionbankcard.hf.space/notecardimage?h={{hashvalue}}&u={{username}}">
|
| 19 |
</meta>
|
|
@@ -24,7 +25,7 @@
|
|
| 24 |
</meta>
|
| 25 |
<meta property="twitter:title" content="RevisionBank NoteCard">
|
| 26 |
</meta>
|
| 27 |
-
<meta property="twitter:description" content="
|
| 28 |
</meta>
|
| 29 |
<meta property="twitter:image" content="https://palondomus-revisionbankcard.hf.space/notecardimage?h={{hashvalue}}&u={{username}}">
|
| 30 |
</meta>
|
|
|
|
| 5 |
|
| 6 |
<title>RevisionBank NoteCard</title>
|
| 7 |
<meta name="title" content="RevisionBank NoteCard"></meta>
|
| 8 |
+
<link rel="icon" href="{{ url_for('static', path='favicon.ico') }}" type="image/x-icon">
|
| 9 |
<meta name="description" content="Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.">
|
| 10 |
</meta>
|
| 11 |
<meta property="og:type" content="website">
|
|
|
|
| 14 |
</meta>
|
| 15 |
<meta property="og:title" content="RevisionBank NoteCard">
|
| 16 |
</meta>
|
| 17 |
+
<meta property="og:description" content="{{subject}} | {{revisioncardtitle}}">
|
| 18 |
</meta>
|
| 19 |
<meta property="og:image" content="https://palondomus-revisionbankcard.hf.space/notecardimage?h={{hashvalue}}&u={{username}}">
|
| 20 |
</meta>
|
|
|
|
| 25 |
</meta>
|
| 26 |
<meta property="twitter:title" content="RevisionBank NoteCard">
|
| 27 |
</meta>
|
| 28 |
+
<meta property="twitter:description" content="{{subject}} | {{revisioncardtitle}}">
|
| 29 |
</meta>
|
| 30 |
<meta property="twitter:image" content="https://palondomus-revisionbankcard.hf.space/notecardimage?h={{hashvalue}}&u={{username}}">
|
| 31 |
</meta>
|