Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.4.0 -> v0.4.1 #19

Merged
merged 7 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
"configurations": [
{
"name": "Python: FastAPI",
"type": "python",
"type": "debugpy",
"request": "launch",
"module": "uvicorn",
"args": [
"src.samapi.main:app",
"--workers=2",
"--host=0.0.0.0",
"--reload"
],
Expand Down
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ conda activate samapi
If you're using a computer with CUDA-compatible GPU, install `cudatoolkit`.

```bash
conda install -c conda-forge -y cudatoolkit=11.7
conda install -c conda-forge -y cudatoolkit=11.8
```

If you're using a computer with CUDA-compatible GPU on Windows, install `torch` with GPU-support with the following command.

```bash
# Windows with CUDA-compatible GPU only
python -m pip install "torch>=1.13.1,<2.0" torchvision --index-url https://download.pytorch.org/whl/cu117
python -m pip install "torch>=2.2.2,<3.0" torchvision --index-url https://download.pytorch.org/whl/cu118
```

Install `samapi` and its dependencies.
Expand Down Expand Up @@ -73,6 +73,13 @@ INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
```

> [!NOTE]
> If you want to access remotely, you may need to launch with `--host 0.0.0.0`.

```bash
uvicorn samapi.main:app --workers 2 --host 0.0.0.0
```

For more information, see [uvicorn documentation](https://www.uvicorn.org/#command-line-options).

### Request body
Expand Down Expand Up @@ -148,7 +155,7 @@ Returns the version of the SAM API.
The version of the SAM API.

```plaintext
0.4.0
0.4.1
```

#### Endpoint `/sam/weights/` (get)
Expand Down Expand Up @@ -226,6 +233,14 @@ The progress.

## Updates

### v0.4.1

- Update dependencies. Related to: [ksugar/qupath-extension-sam#16](https://github.com/ksugar/qupath-extension-sam/issues/16) by [@halqadasi](https://github.com/halqadasi) and [ksugar/samapi#18](https://github.com/ksugar/samapi/issues/18) by [@ArezooGhodsifard](https://github.com/ArezooGhodsifard).
- [cuda-toolkit](https://anaconda.org/nvidia/cuda-toolkit) from `11.7` to `11.8`.
- [gdown](https://github.com/wkentaro/gdown) from `^4.7.1` to `^5.1.0`.
- [torch](https://github.com/pytorch/pytorch) from `^1.13.1` to `^2.2.2`.
- [torchvision](https://github.com/pytorch/vision) from `^0.14.1` to `^0.17.2`.

### v0.4.0

- Support for registering SAM weights from URL. [ksugar/qupath-extension-sam#8](https://github.com/ksugar/qupath-extension-sam/issues/8) [ksugar/samapi#11](https://github.com/ksugar/samapi/pull/11) by [@constantinpape](https://github.com/constantinpape)
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "samapi"
version = "0.4.0"
version = "0.4.1"
description = "Segment Anything Model (SAM) API"
authors = ["Ko Sugawara <[email protected]>"]
readme = "README.md"
Expand All @@ -9,17 +9,17 @@ packages = [{include = "samapi", from = "src"}]
[tool.poetry.dependencies]
python = ">=3.9,<3.12"
fastapi = {extras = ["all"], version = "^0.96.0"}
torch = "^1.13.1,"
torch = "^2.2.2"
mobile_sam = {git = "https://github.com/ksugar/MobileSAM.git"}
geojson = "^3.0.1"
pillow = "^9.5.0"
numpy = "^1.23.5"
scikit-image = "^0.21.0"
shapely = "^2.0.1"
torchvision = "^0.14.1"
torchvision = "^0.17.2"
opencv-python = "^4.7.0.72"
timm = "^0.9.2"
gdown = "^4.7.1"
gdown = "^5.1.0"

[tool.poetry.group.dev.dependencies]
black = "^23.3.0"
Expand Down
Loading