Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about deformable conv visualize #10

Open
huxian0402 opened this issue Apr 23, 2018 · 3 comments
Open

about deformable conv visualize #10

huxian0402 opened this issue Apr 23, 2018 · 3 comments

Comments

@huxian0402
Copy link

Thanks for your amazing work. Have you ever tried to visualize the deformable convolution just like the results in the paper 'Deformable Convolutional Networks'? like this:
deformable_conv_demo1
I made a try to visualize your deformable convolution code. But I get the following results:
figure_1
figure_1-1
Can you help me?

@Zardinality
Copy link
Owner

@huxianxian I am afraid I have no clue on this problem since I have already tested the forward and gradient pass comparing to the original implementation. But still, I am curious about two questions concerning this problem:

  1. How did you visualize the offset? Using the script from original implementation? Or you write it yourself?
  2. How did you get the offset? Using the code from the other repo of mine?

@huxian0402
Copy link
Author

huxian0402 commented Apr 24, 2018

Thanks, Yes ,I visualize the offset with the script from original implementation , and the offset is got from your other repo : https://github.com/Zardinality/TF_Deformable_Net . I have successfully run your code for TF_Deformable_Net on VOC dataset.I get the following results:
Mean AP = 0.6289

Results:
0.708
0.697
0.645
0.475
0.448
0.661
0.792
0.783
0.374
0.634
0.566
0.695
0.716
0.683
0.755
0.363
0.593
0.612
0.760
0.616
0.629

Then i try to make a visualize for deform conv with the trained model , I got the offsets with the following code:

cls_score, cls_prob, bbox_pred, rois , a_offset,b_offset,c_offset, = \
    sess.run([net.get_output('cls_score'), net.get_output('cls_prob'), net.get_output('bbox_pred'),net.get_output('rois'),
          net.get_output('res5a_branch2b_offset'),net.get_output('res5b_branch2b_offset'),net.get_output('res5c_branch2b_offset'),],feed_dict=feed_dict)

all_offsets=[a_offset,b_offset,c_offset]

The I visualize the offsets with the script from original implementation,

res5a_offset = all_offsets[0]
res5b_offset = all_offsets[1]
res5c_offset = all_offsets[2]

im = im[:, :, (2, 1, 0)]

show_dconv_offset(im , [res5c_offset, res5b_offset, res5a_offset])

the function show_dconv_offset(im , [res5c_offset, res5b_offset, res5a_offset]) is the script from original implementation. but I can't get the correct results.

@Zardinality
Copy link
Owner

show_dconv_offset by default uses a step of [2,2], is it relevant to your issue since in Resnet101_train.py we use stride=1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants