Git Product home page Git Product logo

boundaryawarenetwork's Introduction

BoundaryAwareNetwork

A tensorflow implementation of Boundary-Aware Network for Fast and High-Accuracy Portrait Segmentation:https://arxiv.org/pdf/1901.03814.pdf

Things you should know before using the code

I'm just trying to re-implement the result in their paper all out of interest, and haven't succeeded. Please be reminded that there might be errors in my code. If anyone have succeeded in re-implementation please let me know.

boundaryawarenetwork's People

Contributors

lewisluk avatar

Stargazers

 avatar  avatar Anzina Alexandra avatar LuoJianPing avatar  avatar  avatar

Watchers

James Cloos avatar  avatar paper2code - bot avatar

boundaryawarenetwork's Issues

Question about FFM module.

Hi, @lewisluk , thank you for your work. But I have a question about the implementation of Feature Fusion Module(FFM) in model.py, which you directly reduce the input feature to only one channel, and then learn a channel-wise attention. The attention is a scaler as the number of channel is one, that is abnormal. Can you explain it? Thanks a lot.

where is .ckpt file?Thanks

Would you please tell me where to find the checkpoint or ckpt file?Or is should i obtain it through extra steps?

Anyway, thank you all the same for your code !

About loss function

Hello,Thank you for sharing your code.I want to know some detail about the loss function.
In the function,what does logits and factor_lambda mean? Is boundary_target the predicted result?
Thanks.
`def refine_loss(logits, labels, boundary_target):
gamma1 = 0.5
gamma2 = 1-gamma1
factor_lambda= 1.5

dy_logits, dx_logits = tf.image.image_gradients(logits)
dy_labels, dx_labels = tf.image.image_gradients(labels)

# magnitudes of logits and labels gradients
Mpred = tf.sqrt(tf.square(dy_logits)+tf.square(dx_logits))
Mimg = tf.sqrt(tf.square(dy_labels)+tf.square(dx_labels))

# define cos loss and mag loss
cosL = (1-tf.abs(dx_labels*dx_logits+dy_labels*dy_logits))*Mpred
magL = tf.maximum(factor_lambda*Mimg-Mpred,0)

# define mask
M_bound = boundary_target/255.

# define total refine loss
refineLoss = (gamma1*cosL + gamma2*magL)*M_bound
return tf.reduce_mean(refineLoss)
# return  tf.reduce_mean(refineLoss), Mpred, Mimg`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.