Giter VIP home page Giter VIP logo

hed-unet's People

Contributors

khdlr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hed-unet's Issues

I have some questions about testing.

hello,I am a beginner of studying segmentation.After carefully reading the code and paper you provided,I have some questions as follows:

**1.**I am not sure that which part of the code achieve the edge-detection function.I noticed that the HEDUNET in hed_unet.py seems to achieve only segmentation part. Can you tell me where the code is transferred to the HED edge detection task?

**2.**When I start to train my dataset,the result of“showexample” is very nice,SegAcc and EdgeAcc are very high. But when I use the trained model to test pictures,the result looks terrible. I am not sure that there is a problem with my code. My code is as follows:

cuda = True if torch.cuda.is_available() else False
device = torch.device('cpu' if torch.cuda.device_count() == 0
else 'cuda')
model = HEDUNet(input_channels=3, base_channels=16, stack_height=5, batch_norm=True)
model = model.to(device)
model.load_state_dict(torch.load(path_model))
model.eval()

image = np.expand_dims(image.transpose(2,0,1),0)
image = torch.from_numpy(image).to(device)
image = (image.to(torch.float) / 127.) - 1.

res, _ = model(image)
seg_pred, edge_pred = torch.sigmoid(res.squeeze())

pred = np.array(seg_pred.copy())
pred[pred > 0.5] = 255
pred[pred<=0.5] = 0
pred = pred.astype(np.uint8)
pred = pred.reshape((ImgLength, ImgLength))
predicts.append((pred))

pred = np.array(edge_pred.copy())*255
pred = pred.astype(np.uint8)
pred = pred.reshape((ImgLength, ImgLength))
predicts_edge.append((pred))

**3.**I suspect that the reason is "full_forward". Do I need to use "full_forward" when testing? But if it is called, how to fill in parameters like target and metrics?

About training

Hi, I'm from China. After looking at your code, the clock points to the game data. On my side, a picture + a mask (all JPG) directory structure is: images / 1 jpg..... gt/1. Jpg, and you don't need cutting training (it seems that you have done this operation). I don't need it. Can you modify the code of load dataset to make it universal training? In addition, what's the speed of your network? Suppose it's an ordinary GPU; thank

Hed

I am confused about how you do the attention with the softmax? Is it in the channel dimension?
why it can be treated as attention? How can we use the code to do segmentation?

Weight Map

Hello, I want to know how to set the weight value in the weight map. Is there an example? thank you!

Does the edge detection task have an impact on the semantic segmentation task in this model?

Sorry to bother you again.

1.Are semantic segmentation task and edge detection task independent of each other? Or do they have mutual influence?
My own thoughts:
In auto_weight_bce loss, the value of loss.mean() is the combination of two tasks(if the output_channel == 2).

2.What does the “beta” in auto_weight_bce loss mean?
My own thoughts:
It seems to have changed the shape of the target tensor from (B,C,H,W) to (B,C,1,1).
I guess it gave a weight to the two channels of each image in the batchsize.But I'm not sure why you're doing this?
Can we make the sum of the weights of the two channels of each predicted image at different resolution levels equal to 1 by doing this?

Training steps

Hey can you please help me with the training steps? how can I use my dataset and its labels?

About Loss

Hi, I used to train with a loss of 0 x. The effect is good. In the past two days, 1 / 5 of the new data types have been added on the basis of the original data: 6000 white masks (but I want him to learn this type of data because the pixels on the outermost edge are black). At present, 10 epochs have been trained, and loss has increased from 4 to 9, but the edge accuracy has increased slightly, 0.978; The final effect is to successfully learn this new type of data, but it can be more perfect. What causes the loss

About the differences between predictions and queries.

  1. self.queries = nn.ModuleList([nn.Conv2d((1 << i) * bc, output_channels, 1)
    for i in reversed(range(stack_height + 1))])
  2. self.predictors = nn.ModuleList([nn.Conv2d((1 << i) * bc, output_channels, 1)
    for i in reversed(range(stack_height + 1))])

The queries and the predictors seem to be the same.
So What are the differences between the results as follows?

1.full_scale_preds.append(F.interpolate(prediction, size=(H, W), mode='bilinear', align_corners=True))
2.queries = [F.interpolate(q(feat), size=(H, W), mode='bilinear', align_corners=True)
for q, feat in zip(self.queries, multilevel_features)]

About mutil classes

Hello, I want to use your code to train multiple categories of objects and their edge detection. How to achieve it? How to make and read data? Can you give me a hint? It's best to have code examples.

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.