Comments (4)
python app.py --regular_box --captioner blip2 --port 6086 --gradio_share --disable_reuse_features
works
from caption-anything.
the error on my end:
AssertionError
prompt: {'prompt_type': ['click'], 'input_point': [[2205, 1552], [2170, 1490], [1903, 1582], [1571, 995], [1663, 492]], 'input_label': [1, 1, 1, 1, 1], 'multimask_output': 'True'} controls: {'length': 10, 'sentiment': 'Natural', 'factuality': 'Factual', 'language': 'English'}
CA prompt: {'prompt_type': ['click'], 'input_point': [[2205, 1552], [2170, 1490], [1903, 1582], [1571, 995], [1663, 492]], 'input_label': [1, 1, 1, 1, 1], 'multimask_output': 'True'} CA controls {'length': 10, 'sentiment': 'Natural', 'factuality': 'Factual', 'language': 'English'}
Traceback (most recent call last):
File "/mnt/bd/data-tns-algo-us-audio-multimodal/environment/anaconda3/envs/python39/lib/python3.9/site-packages/gradio/routes.py", line 395, in run_predict
output = await app.get_blocks().process_api(
File "/mnt/bd/data-tns-algo-us-audio-multimodal/environment/anaconda3/envs/python39/lib/python3.9/site-packages/gradio/blocks.py", line 1193, in process_api
result = await self.call_function(
File "/mnt/bd/data-tns-algo-us-audio-multimodal/environment/anaconda3/envs/python39/lib/python3.9/site-packages/gradio/blocks.py", line 930, in call_function
prediction = await anyio.to_thread.run_sync(
File "/mnt/bd/data-tns-algo-us-audio-multimodal/environment/anaconda3/envs/python39/lib/python3.9/site-packages/anyio/to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/mnt/bd/data-tns-algo-us-audio-multimodal/environment/anaconda3/envs/python39/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "/mnt/bd/data-tns-algo-us-audio-multimodal/environment/anaconda3/envs/python39/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 867, in run
result = context.run(func, *args)
File "/mnt/bd/data-tns-algo-us-audio-multimodal/environment/anaconda3/envs/python39/lib/python3.9/site-packages/gradio/utils.py", line 491, in async_iteration
return next(iterator)
File "/mnt/bd/data-tns-algo-us-audio-multimodal/experiment/Caption-Anything/app.py", line 115, in inference_seg_cap
out = model.inference(image_input, prompt, controls)
File "/mnt/bd/data-tns-algo-us-audio-multimodal/experiment/Caption-Anything/caption_anything.py", line 26, in inference
seg_mask = self.segmenter.inference(image, prompt)[0, ...]
File "/mnt/bd/data-tns-algo-us-audio-multimodal/environment/anaconda3/envs/python39/lib/python3.9/site-packages/torch/autograd/grad_mode.py", line 28, in decorate_context
return func(*args, **kwargs)
File "/mnt/bd/data-tns-algo-us-audio-multimodal/experiment/Caption-Anything/segmenter/base_segmenter.py", line 53, in inference
assert self.image_embedding is not None
from caption-anything.
The suggestions from GPT-4:
The AssertionError raised in the code is due to the fact that self.image_embedding
is None
. In the base_segmenter.py
file, line 53 checks if self.image_embedding
is not None, and raises an AssertionError if the condition fails:
assert self.image_embedding is not None
This error occurs because the self.image_embedding
attribute of self.segmenter
is not set before calling the inference
method. In the app.py
file, you are setting the image of the segmenter but not setting the image embedding:
model.segmenter.set_image(image_input)
In order to fix this issue, you need to ensure that the image_embedding attribute is properly set before calling the inference method.
First, check if the set_image
implementation calculates and sets the image_embedding
attribute in the segmenter. If not, you might need to adjust the implementation of the set_image
method or create another method to set self.image_embedding
for the segmenter.
Make sure to carefully review the entire codebase to see where and when self.image_embedding
is supposed to be set, and ensure it is correctly calculated and assigned before the inference
method is called.
from caption-anything.
Thank you for raising this issue.
The bug you encountered was due to the previous version of our code, which only extracted embeddings for user-uploaded images. The embeddings for example images were not extracted, causing an assertion error.
We have since resolved this issue. You can find the relevant details and fixes in this commit 28522a8. Please let us know if you have any further questions or concerns.
from caption-anything.
Related Issues (20)
- Related work HOT 2
- Demo crashes both in terminal and in colab HOT 1
- 添加了 "--gradio_share" 后运行demo报错 HOT 2
- 请问能输入一张图片,然后直接输出图片中的内容和相关性吗(也就是不要点击),我想用来给图片生成描述方便搜索 HOT 6
- Torch 1.10.1 not available HOT 2
- Trajectory Support HOT 2
- Hugging Face demo is wrong
- Suggestion - Integrate MobileSAM into the pipeline for lightweight and faster inference
- Segmentation fault (core dumped) HOT 2
- Hugging Face demo is wrong
- Hugging Face demo is wrong
- successfully implemented it without gpt version
- My server can't network to call ChatGPT.
- 进去后怎么点击按钮没有反应呢 HOT 1
- 支持中文对话吗?
- [strange] Dense captions are all filtered out HOT 1
- Can detailed image description text be generated?
- How many tokens would one query use?
- Out of memory with 16G menory + 12G video memory HOT 1
- About interaction HOT 5
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 caption-anything.