Comments (9)
@shiyu22 非常感谢,解决了我的问题,去除async后,现在qps从原先的1到达30+了,基于此issue我提交了一个pr,不好意思我之前还未提交过pr,麻烦你看下是否符合规范,再次感谢您!
from bootcamp.
Hi @yylstudy, you can try to update the Resnet50
in encode.py with the following code:
Note that you need to install towhee with
pip install towhee==1.0.0rc1
. And will release 1.0.0 later.
from towhee import pipe, ops
class Resnet50:
def __init__(self):
self.image_embedding_pipe = (
pipe.input('path')
.map('path', 'img', ops.image_decode.cv2_rgb())
.map('img', 'embedding', ops.image_embedding.timm(model_name='resnet50'))
.map('embedding', 'embedding', ops.towhee.np_normalize())
.output('embedding')
)
def resnet50_extract_feat(self, img_path):
feat = self.image_embedding_pipe(img_path)
return feat.get()[0]
The new towhee code will just load the pipeline just one time.
from bootcamp.
@shiyu22 你好,麻烦再请问下,性能现在是没问题了,但是用上面代码测试后发现distance会变得非常大,之前都是
0.1~1.x之间,这个是为什么呢,谢谢
from bootcamp.
现在milvus版本为v2.0.2,distance的值大小是否与milvus版本有关系
from bootcamp.
现在milvus版本为v2.0.2,distance的值大小是否与milvus版本有关系
No, it's because there is no normalization of the vector. I will add np_normalize() for it.
from bootcamp.
Hi @yylstudy, you can try to update the
Resnet50
in encode.py with the following code:Note that you need to install towhee with
pip install towhee==1.0.0rc1
. And will release 1.0.0 later.from towhee import pipe, ops class Resnet50: def __init__(self): self.image_embedding_pipe = ( pipe.input('path') .map('path', 'img', ops.image_decode.cv2_rgb()) .map('img', 'embedding', ops.image_embedding.timm(model_name='resnet50')) .map('embedding', 'embedding', ops.towhee.np_normalize()) .output('embedding') ) def resnet50_extract_feat(self, img_path): feat = self.image_embedding_pipe(img_path) return feat.get()[0]The new towhee code will just load the pipeline just one time.
@yylstudy can you try it again?
And if it fixed your issue, can you submit a PR to modify the encode.py and be our contributor?
from bootcamp.
It's my pleasure:) And thanks for your contribution.
from bootcamp.
你这个图搜图的效果怎么样?我在用这个的时候发现把已经导入进去的图截取一部分进行搜索,搜不出来之前完整的图片。
from bootcamp.
cropping image may cause significant change of the semantic. so it's not surprising to not return the original full picture.
from bootcamp.
Related Issues (20)
- [BUG]: This file 'video_similarity_search/quick_deploy/README.md' has an command error,'docker logs text-search-webserver' should be 'docker logs video-webserver'. HOT 1
- [FEATURE]: text_search_engine/quick_deploy /docker-compose.yaml HOT 1
- [FEATURE]: Add LLM Related Notebooks
- README for submitting an issue
- question_answering_system/server connect milvus timeout HOT 1
- [BUG]: argument of type 'WindowsPath' is not iterable HOT 4
- 在 图片检索demo中,为什么用另外做个mysql来存储图片路径呢
- [BUG]: wechat group image can not ues
- Columns and DataType Not Explicitly Set on line 13 of load.py
- [BUG]: reverse_image_search图片多了就不能写入数据库 HOT 1
- 启动报错 是网络问题吗 HOT 1
- [BUG]: Error in chunking document in RAG demo "In[8]" HOT 4
- [BUG]: Error in chunking document in RAG demo "In[7]" HOT 1
- Cannot use annotations/citations as CONTEXT HOT 3
- def test_connection(self): try: self.conn.ping() except Exception: self.conn = pymysql.connect(host=MYSQL_HOST, user=MYSQL_USER, port=MYSQL_PORT, password=MYSQL_PWD, database=MYSQL_DB,local_infile=True) self.cursor = self.conn.cursor()[FEATURE]: HOT 3
- [BUG]: 如何支持中文 HOT 3
- 这个仓库历史上已经有了3版本图搜图的代码,哪个版本的效果会好点,区别是什么? HOT 6
- [BUG]: ModuleNotFoundError: No module named 'milvus_utilities' HOT 1
- [BUG]: 'SequenceIterator' object is not iterable in file recommender_system.ipynb
- [BUG]: Logic error on the last batch insert in file recommender_system.ipynb
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootcamp.