Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
b5e52d2
feat(verify): 계열 표를 결과 파일에서 생성한다 — 손으로 옮기지 않는다
Aug 20, 2026
a0f776c
feat(examples): 갈래별 재현 예제 3종 — 전부 실제 학습 가중치로 검증
Aug 20, 2026
951708f
fix(verify): 헤더와 라이브러리의 GGML_MAX_NAME 불일치를 먼저 잡는다
Aug 20, 2026
b5a5926
fix(verify): with_reg=False head 를 이유를 대고 멈춘다
Aug 20, 2026
ca91867
chore: 쓰지 않는 스크립트 둘 제거
Aug 20, 2026
4fd01a3
docs: 정독으로 나온 결함 — 클론 대상·서브커맨드·단계 번호·이름 길이
Aug 20, 2026
a3b425a
docs(mmdet): 정독으로 나온 다섯 — 낡은 판정·기본값·복붙 불가·축 혼동
Aug 20, 2026
e21e6e2
docs(readme): 서브커맨드 표기 통일 + 코드 예제 둘
Aug 20, 2026
a275f2f
docs: 단독 클론에서만 드러나는 셋 — 테스트 기본값·180MB 다운로드·중복 curl
Aug 20, 2026
70b4aa6
docs(readme): 테스트 기본값 설명 정정 — 서브모듈이 아니라 add_subdirectory 가 기준
Aug 20, 2026
775f491
docs: 독자 리뷰로 나온 넷 — 안 돌아가는 예제·이름 없는 저장소·두 이름 한 물건
Aug 20, 2026
f971efd
docs+example: 출력은 항상 PNG 인데 문서가 .jpg 로 쓰고 있었다
Aug 20, 2026
d803cba
docs: 절대경로 링크 8개를 상대경로로 (GitHub 에서 깨진다)
Aug 20, 2026
416391a
docs: 영문 slop 정리 — 습관 두 개 (19곳)
Aug 20, 2026
c7c9f4d
docs: 증거를 가이드에서 분리한다 — verification-report-en.md 신설
Aug 20, 2026
258b076
docs: 출력 예시의 .jpg 5곳 + upstream 어조 3곳 + 보고서 PDF
Aug 20, 2026
c80f856
docs: 문서가 코드와 정반대를 말하던 둘 + 약어 넷
Aug 21, 2026
867a9f9
tools(install_arch): 권하는 출력 이름을 .png 로
Aug 21, 2026
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
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ New here? [**Getting started**](docs/getting-started.md) walks through a first r
| [**ESRGAN**](#real-esrgan) | Super-resolution | CPU, Vulkan |
| [**YOLOv9t**](#yolov9t) | Object detection | CPU |
| [**MMDetection** models](docs/mmdet-detectors.md) | Object detection, segmentation, tracking | CPU |
| [**Compiled PyTorch models**](docs/mmdet-detectors.md#models-whose-head-survives-tracing) | Any traceable `nn.Module` — ultralytics YOLO, torchvision · full guide in the compiler checkout, `docs/vision-cpp-mmdet-guide-en.md` | CPU |
| [**Compiled PyTorch models**](docs/mmdet-detectors.md#models-whose-head-survives-tracing) | Any traceable `nn.Module` — ultralytics YOLO, torchvision · needs the compiler, [GTX_Compiler](https://github.com/Sudo42b/GTX_Compiler), which carries this repository as a submodule | CPU |
| [_Implement a model [**Guide**]_](docs/model-implementation-guide.md) | | |

**Backbones:** SWIN (v1), DINO (v2), TinyViT
Expand All @@ -36,6 +36,10 @@ Get the library and executables:
* Download a [release package](https://github.com/Acly/vision.cpp/releases) and extract it,
* or [build from source](#building).

> Those releases come from upstream and carry the built-in models only. A compiled PyTorch
> model is added by rebuilding this fork — see [MMDetection models](docs/mmdet-detectors.md),
> so [build from source](#building) if that is what you are here for.

### Example: Select an object in an image

Let's use MobileSAM to generate a segmentation mask of the plushy on the right
Expand All @@ -51,7 +55,7 @@ You can download the model and input image here: [MobileSAM-F16.gguf](https://hu
Find the `vision-cli` executable in the `bin` folder and run it to generate the mask:

```sh
vision-cli -m MobileSAM-F16.gguf -i input.jpg -p 420 120 650 430 -o mask.png
vision-cli sam -m MobileSAM-F16.gguf -i input.jpg -p 420 120 650 430 -o mask.png
```
Pass `--composite output.png` to composite input and mask. Use `--help` for more options.

Expand All @@ -61,14 +65,14 @@ Pass `--composite output.png` to composite input and mask. Use `--help` for more
#include <visp/vision.h>
using namespace visp;

void main() {
int main() {
backend_device cpu = backend_init(backend_type::cpu);
sam_model sam = sam_load_model("MobileSAM-F16.gguf", cpu);

image_data input_image = image_load("input.jpg");
sam_encode(sam, input_image);

image_data object_mask = sam_compute(sam, box_2d{{420, 120}, {650, 320}});
image_data object_mask = sam_compute(sam, box_2d{{420, 120}, {650, 430}});
image_save(object_mask, "mask.png");
}
```
Expand Down Expand Up @@ -109,7 +113,7 @@ vision-cli birefnet -m BiRefNet-lite-F16.gguf -i input.png -o mask.png --composi
[Model download](https://huggingface.co/Acly/Depth-Anything-V2-GGUF/tree/main) | [Paper (arXiv)](https://arxiv.org/abs/2406.09414) | [Repository (GitHub)](https://github.com/DepthAnything/Depth-Anything-V2) | License: Apache-2 / CC-BY-NC-4

```sh
vision-cli depth-anything -m Depth-Anything-V2-Small-F16.gguf -i input.png -o depth.png
vision-cli depthany -m Depth-Anything-V2-Small-F16.gguf -i input.png -o depth.png
```

#### MI-GAN
Expand Down Expand Up @@ -150,7 +154,7 @@ To convert a model, install [uv](https://docs.astral.sh/uv/) and run:
```sh
uv run scripts/convert.py <arch> MyModel.pth
```
where `<arch>` is one of `sam, birefnet, esrgan, ...`.
where `<arch>` is one of `sam`, `sam3`, `birefnet`, `depth-anything`, `migan`, `esrgan`.

This will create `models/MyModel.gguf`. See `convert.py --help` for more options.

Expand All @@ -160,7 +164,7 @@ Building requires CMake and a compiler with C++20 support.

**Get the sources**
```sh
git clone https://github.com/Acly/vision.cpp.git --recursive
git clone https://github.com/Sudo42b/vision.cpp.git --recursive
cd vision.cpp
```

Expand All @@ -170,6 +174,10 @@ cmake . -B build
cmake --build build --config Release
```

The configure step downloads the five built-in models — about 180 MB into `models/` — because
tests are on by default in a standalone clone and the tests need them. `-D VISP_TESTS=OFF`
skips both the tests and the download.

### Vulkan _(Optional)_

Building with Vulkan GPU support requires the [Vulkan SDK](https://www.lunarg.com/vulkan-sdk/) to be installed.
Expand All @@ -178,9 +186,12 @@ Building with Vulkan GPU support requires the [Vulkan SDK](https://www.lunarg.co
cmake . -B build -D VISP_VULKAN=ON
```

### Tests _(Optional)_
### Tests

Build with `-DVISP_TESTS=ON`. Run all C++ tests with the following command:
Tests are **on by default** whenever vision.cpp is the project CMake was pointed at — the clone
above, and equally `cmake -S vision.cpp -B vision.cpp/build` from a parent checkout. They are
off only when a parent `CMakeLists.txt` pulls this one in with `add_subdirectory`.
`-D VISP_TESTS=OFF` turns them off in every case. Run all C++ tests with the following command:
```sh
cd build
ctest -C Release
Expand Down
7 changes: 7 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ You should see a list of commands: `sam`, `birefnet`, `depthany`, `migan`, `esrg
> If you would rather build from source, follow [Building](../README.md#building) first, then
> come back here. `vision-cli` ends up in `build/bin`.

> The release packages come from upstream and carry the five built-in models. A model compiled
> from PyTorch is added by rebuilding this fork, so that route starts from source — see
> [MMDetection detectors](mmdet-detectors.md). This tutorial only needs the release.

## Step 2 — Get a model and an image

The executable contains the network structure, but not the weights. Download them:
Expand All @@ -38,6 +42,9 @@ curl -L -O https://huggingface.co/Acly/BiRefNet-GGUF/resolve/main/BiRefNet-lite-
This is BiRefNet, a model that separates a subject from its background. The file is a
[GGUF](https://github.com/ggml-org/ggml/blob/master/docs/gguf.md) — the weights and nothing else.

> Built from source instead? You already have it. Configuring the build downloads all five
> built-in models into `models/`, so use `models/BiRefNet-lite-F16.gguf` and skip the `curl`.

For the input, use any photo with a clear subject. If you cloned the repository, there is one
at `docs/media/input.jpg`. Put it next to the model file and call it `input.jpg`.

Expand Down
Loading
Loading