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

why still need to use conf_mask but not y_true[...,4] #454

Open
speeding-motor opened this issue May 26, 2020 · 6 comments
Open

why still need to use conf_mask but not y_true[...,4] #454

speeding-motor opened this issue May 26, 2020 · 6 comments

Comments

@speeding-motor
Copy link

speeding-motor commented May 26, 2020

I m very confused with this, I still read know the loss_code but still don't know why,
what directly different with this,

conf_mask = conf_mask + tf.to_float(best_ious < 0.6) * (1 - y_true[..., 4])
conf_mask = conf_mask + y_true[..., 4] (forget to multiply best_ious >0.6 ? )

here compute the pred_box and true_box iou in each picture, and get the best anchor for each per cell prod anchor_box,
1、iou_scores shape = [batch_size, grid_w, grid_h, anchor_num, max_box_per_image],
2、and then use,best_iou = tf.reduce_max(iou_scores, axis=4), get each best iou for each cell,
shape =[batch_size, grid_w, grid_h, anchor_num]
3、if the iou <0.6, it means the iou is not enough, so conf_mask[I]=0,
if iou >0.6, if means here probability have box, so conf_mask[i]=1

why still need to calculate the conf_mask but not use y_ture[...,4], just like the coord_mask, it's not easy to got is , every little help is very appreciate, thank in advance
@experiencor @hobson @mrshu @sirotenko @usatenko

@speeding-motor
Copy link
Author

speeding-motor commented May 27, 2020

why need to make a distinction between coord_mask, conf_mask, and class_mask , use the y_true[..., 4] directly is work well ,right?

hope to receive you reply, thanks in advance

@speeding-motor
Copy link
Author

speeding-motor commented May 27, 2020

the code :

class_wt = tf.ones(num_classes)
class_mask = y_true[..., 4] * tf.gather(self.class_wt, true_box_class)     

is total equals to :
class_mask = y_true[..., 4]
so why still have to do like this, is there other detail I have oversight? it's very appreciate to have any help , thanks in advance

@speeding-motor
Copy link
Author

speeding-motor commented May 27, 2020

why need to make a distinction between coord_mask, conf_mask, and class_mask , use the y_true[..., 4] directly is work well ,right?

hope to receive you reply, thanks in advance

no, it's not right to use y_true[..., 0] directly, if we do that it more like to random choice some cell to compute the conf_loss, not relative to the y_pred, so it's wrong

@speeding-motor
Copy link
Author

speeding-motor commented May 28, 2020

maybe use tf.exp(tf.sofrmax(pred[..., 2:4])) instead of tf.exp(pred[..., 2:4]) ?

because tf.exp(pred[..., 2:4]) is always NAN in training

@chhluo
Copy link

chhluo commented Jun 2, 2020

I m very confused with this, I still read know the loss_code but still don't know why,
what directly different with this,

conf_mask = conf_mask + tf.to_float(best_ious < 0.6) * (1 - y_true[..., 4])
conf_mask = conf_mask + y_true[..., 4] (forget to multiply best_ious >0.6 ? )

here compute the pred_box and true_box iou in each picture, and get the best anchor for each per cell prod anchor_box,
1、iou_scores shape = [batch_size, grid_w, grid_h, anchor_num, max_box_per_image],
2、and then use,best_iou = tf.reduce_max(iou_scores, axis=4), get each best iou for each cell,
shape =[batch_size, grid_w, grid_h, anchor_num]
3、if the iou <0.6, it means the iou is not enough, so conf_mask[I]=0,
if iou >0.6, if means here probability have box, so conf_mask[i]=1

why still need to calculate the conf_mask but not use y_ture[...,4], just like the coord_mask, it's not easy to got is , every little help is very appreciate, thank in advance
@experiencor @hobson @mrshu @sirotenko @usatenko

I have the same quesion, please tell me that if you solve the problem.

@speeding-motor
Copy link
Author

I m very confused with this, I still read know the loss_code but still don't know why,
what directly different with this,

conf_mask = conf_mask + tf.to_float(best_ious < 0.6) * (1 - y_true[..., 4])
conf_mask = conf_mask + y_true[..., 4] (forget to multiply best_ious >0.6 ? )

here compute the pred_box and true_box iou in each picture, and get the best anchor for each per cell prod anchor_box,
1、iou_scores shape = [batch_size, grid_w, grid_h, anchor_num, max_box_per_image],
2、and then use,best_iou = tf.reduce_max(iou_scores, axis=4), get each best iou for each cell,
shape =[batch_size, grid_w, grid_h, anchor_num]
3、if the iou <0.6, it means the iou is not enough, so conf_mask[I]=0,
if iou >0.6, if means here probability have box, so conf_mask[i]=1
why still need to calculate the conf_mask but not use y_ture[...,4], just like the coord_mask, it's not easy to got is , every little help is very appreciate, thank in advance
@experiencor @hobson @mrshu @sirotenko @usatenko

I have the same quesion, please tell me that if you solve the problem.

I stil not got this

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