@@ -192,7 +192,7 @@ Similarity between images: 87.5%
192192全局参数(适用于所有子命令):
193193- ` -d DB_NAME ` :指定数据库名称(默认:` default ` )
194194- ` -B BIND ` :服务绑定地址(默认:` ~/.isearch/isearch.sock ` ;TCP 格式:` host:port ` )
195- - ` -v, --version ` :显示版本(当前:0.1.1 )
195+ - ` -v, --version ` :显示版本(当前:0.2.0 )
196196
197197子命令特定参数见上文。
198198
@@ -246,19 +246,19 @@ print(f'清空成功: {cleared}')
246246
247247ImgSearch 支持多种 TinyCLIP 模型变体,平衡速度、准确率和资源。默认 ` ViT-45LY ` 适用于大多数场景。
248248
249- | 模型键 | ImageNet-1K Acc@1 (%) | MACs (G) | Throughput (pairs/s) | 推荐场景 |
250- | ----------| -----------------------| ----------| ----------------------| -----------------------------|
251- | ViT-8Y | 41.1 | 2.0 | 4,150 | 移动/低资源,快速但基本准确 |
252- | RN-19L | 56.4 | 4.4 | 3,024 | 平衡,CPU 友好 |
253- | ViT-22L | 53.7 | 1.9 | 5,504 | 高速搜索 |
254- | RN-30L | 59.1 | 6.9 | 1,811 | 中等准确,GPU 加速 |
255- | ViT-39Y | 63.5 | 9.5 | 1,469 | 高准确,大型数据集 |
256- | ViT-40L | 59.8 | 3.5 | 4,641 | 通用桌面 |
257- | ViT-45L | 61.4 | 3.7 | 3,682 | 平衡(默认备选) |
258- | ViT-45LY | 62.7 | 1.9 | 3,685 | ** 默认:最佳平衡 ** |
259- | ViT-61L | 62.4 | 5.3 | 3,191 | 高准确,中等速度 |
260- | ViT-63L | 63.9 | 5.6 | 2,905 | 生产环境,高召回 |
261- | ViT-63LY | 64.5 | 5.6 | 2,909 | 最高准确,资源密集 |
249+ | 模型键 | ImageNet-1K Acc@1 (%) | MACs (G) | Throughput (pairs/s) | 推荐场景 |
250+ | ----------| -----------------------| ----------| ----------------------| ------------------------------------ |
251+ | ViT-8Y | 41.1 | 2.0 | 4,150 | 资源消耗最低,速度快,准确度略低 |
252+ | RN-19L | 56.4 | 4.4 | 3,024 | |
253+ | ViT-22L | 53.7 | 1.9 | 5,504 | 速度最快,适合对速度要求高的场景 |
254+ | RN-30L | 59.1 | 6.9 | 1,811 | |
255+ | ViT-39Y | 63.5 | 9.5 | 1,469 | 准确度高,资源消耗中等,但速度较慢 |
256+ | ViT-40L | 59.8 | 3.5 | 4,641 | |
257+ | ViT-45L | 61.4 | 3.7 | 3,682 | |
258+ | ViT-45LY | 62.7 | 1.9 | 3,685 | ** 默认:最佳均衡 ** ,速度与精度兼备 |
259+ | ViT-61L | 62.4 | 5.3 | 3,191 | |
260+ | ViT-63L | 63.9 | 5.6 | 2,905 | |
261+ | ViT-63LY | 64.5 | 5.6 | 2,909 | 准确度最高 |
262262
263263数据来源:TinyCLIP 模型库。选择小模型(如 ViT-8Y)用于低端设备;大模型(如 ViT-63LY)用于高精度需求。切换模型需重启服务:` isearch service start -m MODEL_KEY ` 。
264264
@@ -278,41 +278,6 @@ src/imgsearch/
278278
279279测试目录:` src/test/ ` (包含单元测试,使用 pytest)。
280280
281- ## 性能和故障排除
282-
283- - ** 内存使用** :空数据库 ~ 50MB;每 1000 张图片 ~ 20-50MB(取决于模型)。服务启动后预加载模型,初始 ~ 200-500MB。
284- - ** 搜索速度** :~ 1-5ms/查询(取决于 k 和 ef 参数,CPU 上)。
285- - ** 常见问题** :
286- - 服务未运行:` Failed to connect to service ` - 运行 ` isearch service start ` 。
287- - 队列满:高负载时搜索返回 None - 等待或增加并发(修改 server.py)。
288- - 模型加载慢:首次启动预加载,GPU 加速显著。
289- - 数据库损坏:删除 ` ~/.isearch/数据库名/ ` 重建。
290-
291- 监控:使用 ` isearch service status ` 查看 PID 和内存。
292-
293- ## 贡献和测试
294-
295- 欢迎贡献!运行测试:
296-
297- ``` shell
298- pytest src/test/
299- ```
300-
301- 确保代码风格一致,使用现代 Python(>=3.11)。详见 [ 贡献指南] ( CONTRIBUTING.md ) (若存在)。
302-
303- ## 依赖
304-
305- - Python >=3.11
306- - torch >=2.2.2 (CPU/GPU)
307- - open-clip-torch (TinyCLIP)
308- - hnswlib >=0.8.0
309- - pyro5 >=5.15
310- - Pillow >=11.3.0
311- - psutil >=7.0.0
312- - bidict >=0.23.1
313- - msgpack >=1.1.1
314- - numpy (平台特定)
315-
316281## 许可证
317282
318283MIT License
@@ -513,7 +478,7 @@ Similarity between images: 87.5%
513478Global args (all subcommands):
514479- ` -d DB_NAME ` : Database name (default: ` default ` )
515480- ` -B BIND ` : Service bind (default: ` ~/.isearch/isearch.sock ` ; TCP: ` host:port ` )
516- - ` -v, --version ` : Show version (current: 0.1.1)
481+ - ` -v, --version ` : Show version
517482
518483Subcommand-specific: See above.
519484
@@ -567,21 +532,21 @@ print(f'Cleared: {cleared}')
567532
568533ImgSearch supports various TinyCLIP model variants, balancing speed, accuracy, resources. Default ` ViT-45LY ` for most cases.
569534
570- | Model Key | ImageNet-1K Acc@1 (%) | MACs (G) | Throughput (pairs/s) | Recommended For |
571- | -----------| -----------------------| ----------| ----------------------| -------------------------------------|
572- | ViT-8Y | 41.1 | 2.0 | 4,150 | Mobile/low- resource, fast but basic |
573- | RN-19L | 56.4 | 4.4 | 3,024 | Balanced, CPU-friendly |
574- | ViT-22L | 53.7 | 1.9 | 5,504 | High- speed search |
575- | RN-30L | 59.1 | 6.9 | 1,811 | Medium accuracy, GPU |
576- | ViT-39Y | 63.5 | 9.5 | 1,469 | High accuracy, large data |
577- | ViT-40L | 59.8 | 3.5 | 4,641 | General desktop |
578- | ViT-45L | 61.4 | 3.7 | 3,682 | Balanced (default alt) |
579- | ViT-45LY | 62.7 | 1.9 | 3,685 | ** Default: Best balance** |
580- | ViT-61L | 62.4 | 5.3 | 3,191 | High accuracy, medium speed |
581- | ViT-63L | 63.9 | 5.6 | 2,905 | Production, high recall |
582- | ViT-63LY | 64.5 | 5.6 | 2,909 | Highest accuracy, intensive |
583-
584- Data from TinyCLIP model zoo. Use small models (ViT-8Y) for low-end; large ( ViT-63LY) for precision. Switch : ` isearch service start -m MODEL_KEY ` .
535+ | Model Key | ImageNet-1K Acc@1 (%) | MACs (G) | Throughput (pairs/s) | Recommended Scenarios |
536+ | -----------| -----------------------| ----------| ----------------------| ----------------------------------------------------------------------- |
537+ | ViT-8Y | 41.1 | 2.0 | 4,150 | Lowest resource usage , fast performance, with slightly lower accuracy |
538+ | RN-19L | 56.4 | 4.4 | 3,024 | |
539+ | ViT-22L | 53.7 | 1.9 | 5,504 | Fastest speed, ideal for scenarios with high speed requirements |
540+ | RN-30L | 59.1 | 6.9 | 1,811 | |
541+ | ViT-39Y | 63.5 | 9.5 | 1,469 | High accuracy, moderate resource consumption, but slower speed |
542+ | ViT-40L | 59.8 | 3.5 | 4,641 | |
543+ | ViT-45L | 61.4 | 3.7 | 3,682 | |
544+ | ViT-45LY | 62.7 | 1.9 | 3,685 | ** Default: Best balance** of speed and accuracy |
545+ | ViT-61L | 62.4 | 5.3 | 3,191 | |
546+ | ViT-63L | 63.9 | 5.6 | 2,905 | |
547+ | ViT-63LY | 64.5 | 5.6 | 2,909 | Highest accuracy |
548+
549+ Data source: TinyCLIP model library. Choose small models (e.g., ViT-8Y) for low-end devices ; large models (e.g., ViT-63LY) for high- precision needs. To switch models, restart the service : ` isearch service start -m MODEL_KEY ` .
585550
586551## Directory Structure
587552
@@ -599,41 +564,6 @@ src/imgsearch/
599564
600565Tests: ` src/test/ ` (unit tests with pytest).
601566
602- ## Performance and Troubleshooting
603-
604- - ** Memory** : Empty DB ~ 50MB; per 1000 images ~ 20-50MB (model-dependent). Service preload ~ 200-500MB initial.
605- - ** Search Speed** : ~ 1-5ms/query (depends on k, ef; CPU).
606- - ** Common Issues** :
607- - Service not running: ` Failed to connect ` - Run ` isearch service start ` .
608- - Queue full: Search returns None (high load) - Wait or increase concurrency (edit server.py).
609- - Slow model load: First start preloads; GPU speeds up.
610- - Corrupt DB: Delete ` ~/.isearch/db_name/ ` and rebuild.
611-
612- Monitor: ` isearch service status ` for PID/memory.
613-
614- ## Contributions and Testing
615-
616- Contributions welcome! Run tests:
617-
618- ``` shell
619- pytest src/test/
620- ```
621-
622- Follow style, use modern Python (>=3.11). See [ CONTRIBUTING.md] if available.
623-
624- ## Dependencies
625-
626- - Python >=3.11
627- - torch >=2.2.2 (CPU/GPU)
628- - open-clip-torch (TinyCLIP)
629- - hnswlib >=0.8.0
630- - pyro5 >=5.15
631- - Pillow >=11.3.0
632- - psutil >=7.0.0
633- - bidict >=0.23.1
634- - msgpack >=1.1.1
635- - numpy (platform-specific)
636-
637567## License
638568
639569MIT License
0 commit comments