KimRass / YOLO

PyTorch implementation of 'YOLO' (Redmon et al., 2016) from scratch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

1. Theorectical Background

  • Comment: 이 수식의 의미는, '해당 그리드 셀에 오브젝트가 존재한다면' 그 오브젝트의 클래스가 $Class$일 확률입니다.
  • Comment: ground truth bounding box와의 IoU가 낮더라도 오브젝트가 존재할 확률이 높거나 오브젝트가 존재할 확률이 높더라도 ground truth bounding box와의 IoU가 높으면 confidence는 높은 값을 가집니다. $$P(Object) \cdot IOU^{gt}{pred}$$ $$\lambda{coord} \sum^{S^{2}}{i = 0} \sum^{B}{j = 0} \mathbb{1}^{obj}{ij} \bigg[(x{i} - \hat{x}{i})^{2} + (y{i} - \hat{y}{i})^{2} + (\sqrt{w{i}} - \sqrt{\hat{w}{i}})^{2} + (\sqrt{h{i}} - \sqrt{\hat{h}{i}})^{2} + (C{i} - \hat{C}{i})^{2}\bigg] \+ \sum^{S^{2}}{i = 0} \mathbb{1}^{obj}{i} \sum{c \in classes} \big(p_{i}(c) - \hat{p}{i}(c)\big)^{2} \+ \lambda{noobj} \sum^{S^{2}}{i = 0} \sum^{B}{j = 0} 1^{noobj}{ij} \big(C{i} - \hat{C}_{i}\big)^{2}$$
  • $\mathbb{1}^{obj}_{i}$: Denotes if object appears in cell $i$
  • $\mathbb{1}^{obj}_{ij}$: Denotes that the $j$ th bounding box predictor in cell $i$ is "responsible" for that prediction.

$$\lambda_{coord} \sum^{S^{2}}{i = 0} \sum^{B}{j = 0} \mathbb{1}^{obj}{ij} \bigg[ (x{i} - \hat{x}{i})^{2} + (y{i} - \hat{y}{i})^{2} \bigg]$$ $$\lambda{coord} \sum^{S^{2}}{i = 0} \sum^{B}{j = 0} \mathbb{1}^{obj}{ij} \bigg[ (\sqrt{w{i}} - \sqrt{\hat{w}{i}})^{2} + (\sqrt{h{i}} - \sqrt{\hat{h}{i}})^{2} \bigg]$$ $$\sum^{S^{2}}{i = 0} \sum^{B}{j = 0} \mathbb{1}^{obj}{ij} (C_{i} - \hat{C}{i})^{2}$$ $$\lambda{noobj} \sum^{S^{2}}{i = 0} \sum^{B}{j = 0} 1^{noobj}{ij} \big( C{i} - \hat{C}{i} \big)^{2}$$ $$\sum^{S^{2}}{i = 0} \mathbb{1}^{obj}{i} \sum{c \in classes} \big(p_{i}(c) - \hat{p}_{i}(c)\big)^{2}$$

2. References

About

PyTorch implementation of 'YOLO' (Redmon et al., 2016) from scratch


Languages

Language:Python 99.1%Language:Shell 0.9%