Skip to content

Commit

Permalink
update: api (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincentqyw authored Oct 5, 2024
1 parent 5a1b91c commit 13037f0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
Empty file added api/__init__.py
Empty file.
4 changes: 2 additions & 2 deletions api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ def send_generate_request2(image_path: str) -> Dict[str, np.ndarray]:
"--image0",
required=False,
help="Path for the file's melody",
default="../datasets/sacre_coeur/mapping_rot/02928139_3448003521_rot45.jpg",
default="datasets/sacre_coeur/mapping_rot/02928139_3448003521_rot45.jpg",
)
parser.add_argument(
"--image1",
required=False,
help="Path for the file's melody",
default="../datasets/sacre_coeur/mapping_rot/02928139_3448003521_rot90.jpg",
default="datasets/sacre_coeur/mapping_rot/02928139_3448003521_rot90.jpg",
)
args = parser.parse_args()
for i in range(10):
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"engines": {
"node": "18.x"
}
}
2 changes: 0 additions & 2 deletions api/server.py → server.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# server.py
import sys
from pathlib import Path
from typing import Union

Expand All @@ -9,7 +8,6 @@
from fastapi.responses import JSONResponse
from PIL import Image

sys.path.append("..")
from pydantic import BaseModel

from ui.api import ImageMatchingAPI
Expand Down
14 changes: 14 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"builds": [
{
"src": "server.py",
"use": "@vercel/python"
}
],
"routes": [
{
"src": "/(.*)",
"dest": "server.py"
}
]
}

0 comments on commit 13037f0

Please sign in to comment.