LisaAnne / LocalizingMoments

Github for my ICCV 2017 paper: "Localizing Moments in Video with Natural Language"
188 stars 44 forks source link

why need add 1 ? #18

Open xinfangliu opened 4 years ago

xinfangliu commented 4 years ago

in utils/eval.py def iou(pred, gt): intersection = max(0, min(pred[1], gt[1]) + 1 - max(pred[0], gt[0])) union = max(pred[1], gt[1]) + 1 - min(pred[0], gt[0]) return float(intersection)/union

if p=[3,5] g=[4,6] then the iou should be (5-4)/(6-3)=0.33333 but iou(p,g)=0.5 Did I get it wrong?

LisaAnne commented 4 years ago

It's because the start and end points are inclusive so p includes segments 3, 4, and 5 and g includes segments 4, 5 and 6. The union is segments 3, 4, 5, and 6 and the intersection is segments 4 and 5. This iou should be 0.5.

On Fri, Nov 15, 2019, 6:48 AM 刘新放 notifications@github.com wrote:

in utils/eval.py def iou(pred, gt): intersection = max(0, min(pred[1], gt[1]) + 1 - max(pred[0], gt[0])) union = max(pred[1], gt[1]) + 1 - min(pred[0], gt[0]) return float(intersection)/union

if p=[3,5] g=[4,6] then the iou should be (5-4)/(6-3)=0.33333 but iou(p,g)=0.5 Did I get it wrong?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/LisaAnne/LocalizingMoments/issues/18?email_source=notifications&email_token=ABKCNWX6IWD26FIDM3COZCTQTZA5JA5CNFSM4JNWMYDKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HZQX4NQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKCNWTSM5H2B4LF3V5T5XDQTZA5JANCNFSM4JNWMYDA .

xinfangliu commented 4 years ago

understand,thank you------------------ 原始邮件 ------------------ 发件人: "Lisa Anne Hendricks"notifications@github.com 发送时间: 2019年11月15日(星期五) 下午5:25 收件人: "LisaAnne/LocalizingMoments"LocalizingMoments@noreply.github.com; 抄送: "刘新放"406736552@qq.com;"Author"author@noreply.github.com; 主题: Re: [LisaAnne/LocalizingMoments] why need add 1 ? (#18)

It's because the start and end points are inclusive so p includes segments 3, 4, and 5 and g includes segments 4, 5 and 6. The union is segments 3, 4, 5, and 6 and the intersection is segments 4 and 5. This iou should be 0.5.

On Fri, Nov 15, 2019, 6:48 AM 刘新放 notifications@github.com wrote:

in utils/eval.py def iou(pred, gt): intersection = max(0, min(pred[1], gt[1]) + 1 - max(pred[0], gt[0])) union = max(pred[1], gt[1]) + 1 - min(pred[0], gt[0]) return float(intersection)/union

if p=[3,5] g=[4,6] then the iou should be (5-4)/(6-3)=0.33333 but iou(p,g)=0.5 Did I get it wrong?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/LisaAnne/LocalizingMoments/issues/18?email_source=notifications&email_token=ABKCNWX6IWD26FIDM3COZCTQTZA5JA5CNFSM4JNWMYDKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HZQX4NQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKCNWTSM5H2B4LF3V5T5XDQTZA5JANCNFSM4JNWMYDA .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.