Skip to content

Commit bcfbc53

Browse files
committed
docs(cat_finder): add curl command
1 parent 7779b8c commit bcfbc53

2 files changed

Lines changed: 27 additions & 5 deletions

File tree

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,22 @@ MegFlow 是一个面向视觉应用的流式计算框架, 目标是简单、高
4242
- [Apache 2.0](LICENSE)
4343

4444
## Acknowledgement
45-
46-
MegFlow 使用了下列项目:
45+
MegFlow Rust 使用了以下项目:
4746
* [FFmpeg](https://github.com/FFmpeg/FFmpeg)
47+
* [Swagger](https://github.com/Metaswitch/swagger-rs)
48+
* [toml](https://github.com/alexcrichton/toml-rs)
49+
* [stackful](https://github.com/nbdd0121/stackful)
50+
51+
MegFlow Python 使用了下列项目:
4852
* [OpenCV](https://github.com/opencv/opencv)
4953
* [numpy](https://github.com/numpy/numpy)
5054
* [loguru](https://pypi.org/project/loguru/)
5155
* [scipy](https://github.com/scipy/scipy)
5256
* [redis](https://github.com/redis/redis)
57+
58+
MegFlow 模型和推理学习了这些项目:
5359
* [MegEngine](https://github.com/megengine/megengine)
5460
* [onnx](https://github.com/onnx/onnx)
5561
* [YOLOX](https://github.com/Megvii-BaseDetection/YOLOX)
5662
* [AlignedReID](https://github.com/huanghoujing/AlignedReID-Re-Production-Pytorch)
5763
* [MEMD](https://github.com/megvii-research/MEMD)
58-

flow-python/examples/cat_finder/README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ $ cargo run --example run_with_plugins -- -c cat_finder/image_cpu.toml -p cat_f
6969
![](images/cat_finder_image_result.jpg)
7070

7171

72-
FAQ:如果服务部署在 docker 里,,运行时容器使用端口映射,把内部的 8081 端口映射到宿主机。例如把内部容器的 8081 映射成外部物理机的 18081、把 8082 映射成 18082
72+
## 图片注册 FAQ
73+
如果服务部署在 docker 里、客户端无法直连,这里提供 2 种方法:
74+
75+
1. 运行时容器使用端口映射。例如把内部容器的 8081 映射成外部物理机的 18081、把 8082 映射成 18082
7376
```bash
7477
$ docker run -p 18081:8081 -p 18082:8082 -it ubuntu /bin/bash
7578
```
@@ -82,6 +85,12 @@ d4b5b563051e ubuntu "/bin/bash" 9 seconds ago Up 8 seconds 0.0.0.0:18
8285
```
8386
浏览器打开宿主机的 ip:18081 端口即可使用
8487

88+
2. 在容器内用 `cURL` 发 HTTP POST 请求,不再用 web UI
89+
```bash
90+
$ curl http://127.0.0.1:8081/analyze/my_cat_name -X POST --header "Content-Type:image/*" --data-binary @test.jpeg --output out.jpg
91+
```
92+
`my_cat_name` 是注册的猫咪名称;`test.jpeg` 是测试图片;`output.jpg` 是返回的可视化图片。
93+
8594
## 视频识别
8695

8796
准备一个 rtsp 视频流地址,做测试输入(因不可抗力 MegFlow 无法提供现成地址)。模型包目录提供了测试视频,在 `models/cat_finder_testdata`,需要用户自行部署 live555 服务。最直接的办法:
@@ -138,7 +147,15 @@ $ redis-cli
138147
`brpop notification.cat_finder` 可消费报警消息。
139148

140149

141-
FAQ:如果服务部署在 docker 里,同样可以把 8082 端口映射到宿主机端口。
150+
## 视频识别 FAQ
151+
如果服务部署在 docker 里,同样可以把 8082 端口映射到宿主机端口;对应的 `cURL` 命令参考
152+
```bash
153+
$ curl -X POST 'http://127.0.0.1:8082/start/rtsp%3A%2F%2F127.0.0.1%3A8554%2Ftest1.ts' # start rtsp://127.0.0.1:8554/test1.ts
154+
start stream whose id is 2%
155+
$ curl 'http://127.0.0.1:8082/list' # list all stream
156+
[{"id":1,"url":"rtsp://10.122.101.175:8554/test1.ts"},{"id":0,"url":"rtsp://10.122.101.175:8554/test1.ts"}]%
157+
```
158+
路径中的 `%2F``%3A`[URL](https://www.ietf.org/rfc/rfc1738.txt) 的转义字符
142159

143160
## 模型列表
144161

0 commit comments

Comments
 (0)