dwardzheng / mffn_cod Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hi! I read your paper "MFFN: Multi-view Feature Fusion Network for Camouflaged Object Detection", Thanks for the great work! I would like to ask if you can publish the code and dataset of the paper?
您好,感谢您杰出的工作。我想请问一下在CAMV模块中attn_md经过tl.tenalg.mode_dot()函数计算之后是不是得到(B, 1, mm_size, mm_size)的attention map,以及为什么要使用torch.softmax(dim=1),这似乎将attn_md变成了全为1.的tensor?
Nice work, but I have a question while reading, how did you make your PR curves and F-measure curves, looking forward to your reply!
Your work is fantastic and I look forward to sharing your code!
Firstly, thank you for your great work!
However, I encountered some problems while running test.sh
.
At first, the error shows that in /root/MFFN_COD/dataset/MultiView_cod.py
something went wrong:
Traceback (most recent call last):
File "test.py", line 146, in <module>
main()
File "test.py", line 142, in main
testing(model=model, cfg=cfg)
File "/usr/local/miniconda3/envs/MFF/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "test.py", line 118, in testing
seg_results = test_once(
File "test.py", line 78, in test_once
for batch_id, batch in pgr_bar:
File "/usr/local/miniconda3/envs/MFF/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 652, in __next__
data = self._next_data()
File "/usr/local/miniconda3/envs/MFF/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1347, in _next_data
return self._process_data(data)
File "/usr/local/miniconda3/envs/MFF/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1373, in _process_data
data.reraise()
File "/usr/local/miniconda3/envs/MFF/lib/python3.8/site-packages/torch/_utils.py", line 461, in reraise
raise exception
NameError: Caught NameError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/usr/local/miniconda3/envs/MFF/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop
data = fetcher.fetch(index)
File "/usr/local/miniconda3/envs/MFF/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/usr/local/miniconda3/envs/MFF/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/root/MFFN_COD/dataset/MultiView_cod.py", line 49, in __getitem__
"image_c1": image_c_1,
NameError: name 'image_c_1' is not defined
Then I edited this file and make some changes:
line47 from
return dict(
data={
"image_c1": image_c_1,
"image_o": image_o,
"image_c2": image_c_2,
"image_a1": image_a_1,
"image_a2": image_a_2,
},
to
return dict(
data={
"image_c1": image_0_5,
"image_o": image_1_0,
"image_c2": image_1_5,
"image_a1": image_a_1,
"image_a2": image_a_2,
},
Then after running again, another problem showed up in /root/MFFN_COD/methods/MFFN/MFFN.py
:
Traceback (most recent call last):
File "test.py", line 146, in <module>
main()
File "test.py", line 142, in main
testing(model=model, cfg=cfg)
File "/usr/local/miniconda3/envs/MFF/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "test.py", line 118, in testing
seg_results = test_once(
File "test.py", line 85, in test_once
logits = model(data=batch_images)
File "/usr/local/miniconda3/envs/MFF/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/root/MFFN_COD/methods/module/base_model.py", line 17, in forward
results = self.test_forward(*args, **kwargs)
File "/root/MFFN_COD/methods/MFFN/MFFN.py", line 416, in test_forward
output = self.body(
TypeError: body() got an unexpected keyword argument 'l_scale'
terminate called without an active exception
Then I edited the code as shown below:
line415 from
def test_forward(self, data, **kwargs):
output = self.body(
l_scale=data["image_c1"],
o_scale=data["image_o"],
s_scale=data["image_c2"],
a1_scale=data["image_a1"],
a2_scale=data["image_a2"],
)
return output["seg"]
to
def test_forward(self, data, **kwargs):
output = self.body(
c1_scale=data["image_c1"],
o_scale=data["image_o"],
c2_scale=data["image_c2"],
a1_scale=data["image_a1"],
a2_scale=data["image_a2"],
)
return output["seg"]
Then the code works. However, the output of the evaluation process become a pure grey image with no predicted mask in it. I wonder what is wrong with my actions. Newbee to the field, look up to your great project.
Looking forward to your reply! THX
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.