Skip to content

Commit

Permalink
update: ray serve
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincentqyw committed Nov 2, 2024
1 parent c4cc6ab commit 1d9105d
Show file tree
Hide file tree
Showing 6 changed files with 375 additions and 331 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ python -m api.server

### Run demo
``` bash
python3 ./app.py
python ./app.py
```
then open http://localhost:7860 in your browser.

Expand Down Expand Up @@ -133,7 +133,14 @@ Adding local features / matchers as submodules is very easy. For example, to add
git submodule add https://github.com/cvg/GlueStick.git third_party/GlueStick
```

If remote submodule repositories are updated, don't forget to pull submodules with `git submodule update --remote`, if you only want to update one submodule, use `git submodule update --remote third_party/GlueStick`.
If remote submodule repositories are updated, don't forget to pull submodules with:

``` bash
git submodule init
git submodule update --remote
```

if you only want to update one submodule, use `git submodule update --remote third_party/GlueStick`.

## Contributors

Expand Down
20 changes: 16 additions & 4 deletions api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import sys
from typing import List
from pydantic import BaseModel
import base64
import io
import sys
from pathlib import Path
from typing import List

import numpy as np
from fastapi.exceptions import HTTPException
from PIL import Image
from pathlib import Path
from pydantic import BaseModel

sys.path.append(str(Path(__file__).parents[1]))

from hloc import logger

from .core import ImageMatchingAPI


class ImagesInput(BaseModel):
data: List[str] = []
Expand Down Expand Up @@ -40,3 +44,11 @@ def decode_base64_to_image(encoding):

def to_base64_nparray(encoding: str) -> np.ndarray:
return np.array(decode_base64_to_image(encoding)).astype("uint8")


__all__ = [
"ImageMatchingAPI",
"ImagesInput",
"decode_base64_to_image",
"to_base64_nparray",
]
2 changes: 1 addition & 1 deletion api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import numpy as np
import requests

ENDPOINT = "http://127.0.0.1:8000"
ENDPOINT = "http://127.0.0.1:8001"
if "REMOTE_URL_RAILWAY" in os.environ:
ENDPOINT = os.environ["REMOTE_URL_RAILWAY"]

Expand Down
2 changes: 1 addition & 1 deletion api/config/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
proxy_location: EveryNode
http_options:
host: 0.0.0.0
port: 8000
port: 8001

grpc_options:
port: 9000
Expand Down
Loading

0 comments on commit 1d9105d

Please sign in to comment.