-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Hi, thanks for your very useful code!
I want to ask you something about the loss function, because I've seen it implemented in many ways but this seems the best one:
-
Is it correct to compute a single mask for an entire batch and compute the loss on it? This should be the wrong way because many objects could be in the same cell, so we will have overlapping. I'm quite sure this is not the way it is implemented here.
-
Is it correct to compute the mask for each single image and then compute the loss as the average on the batch, like:
total_loss = 1/N sum_for_every_image(image_loss)
This is the way it is implemented here I think, but can you confirm this? Unfortunately it is not clear how to compute it exactly.
Also can you explain the following line found in "yolo_v2_confidence_loss"?
object_no_detections = tf.cast(iou < 0.6, tf.float32)
objects_loss = object_scale * object_mask * object_no_detections * tf.square(1 - box_confidence)
I imagine you are thresholding the iou between the ground truth boxes and the predictions, but can you explain this choice? Are you saying that even if the box is in the right cell it must have iou > 0.6 w.r.t. ground truth to be counted in this loss?
Lastly, are you planning to add the possibility to load pre-trained weights? It will be useful and if you want I could also help.
Thanks, Andrea