Toma0916 / GlobalWheatDetection

3 stars 0 forks source link

mix系追加とバグ修正 #97

Closed Toma0916 closed 4 years ago

Toma0916 commented 4 years ago

スクリーンショット 2020-05-25 14 11 11

cutmix ラベル落としのロジックどうしよ

Toma0916 commented 4 years ago

スクリーンショット 2020-05-25 14 21 22

mixup こっちはラベル重ねていいのかな

Toma0916 commented 4 years ago

それぞれラベルの処理だけはまだしてないというか適当なんですけどどうするのがいいかな。

一応重なりの度合いみたいなパラメタはオリジナルに忠実に beta(0.5, 0.5)からサンプリングしてる

Toma0916 commented 4 years ago

https://keisan.casio.jp/exec/system/1161228837

スクリーンショット 2020-05-25 14 32 12

バランス良くさんサンプリングするなら 0.5 -> 2とかの方がいいと思うけど、薄いところにラベルつけてても意味ないしそのほうがいいんかな

kminoda commented 4 years ago

最初のcutmixのは、ラベルを両方ともフルで載せているということ? (x1, y1, x2, y2)のformatなら境界でnp.clipすれば良いとかそういうことですかね

kminoda commented 4 years ago

object detectionでのmixupがよくわかっていないんだけど 例えば上のやつの場合だったら、labelを0(背景)と1(小麦)で混ぜ合わせる的な感じなんですかね?

Toma0916 commented 4 years ago

たぶんですけど 不要なboxを落としちゃう感じなんじゃないですかね

Toma0916 commented 4 years ago
スクリーンショット 2020-05-25 14 47 34

mixupは足して良さそう

kminoda commented 4 years ago

3枚目もはや気持ち悪い

kminoda commented 4 years ago

密だ

Toma0916 commented 4 years ago

cutmixの方、どういう基準でラベル落とそう

kminoda commented 4 years ago

不要なboxってcutmixの方か 元のkernelでは実際にtrainingでどうやってるのかわからなかったんだよな ググってもよくわからんかった

Toma0916 commented 4 years ago

ちょっといい感じにダブってたら落とすってやつをやろうと思う

kminoda commented 4 years ago

bboxのIoUで判定するということ? でも同じbboxでも小麦の向きによって同じと判定するべきか別々で判定するべきか変わってきそうだよな

Toma0916 commented 4 years ago

iou的なサムシングでいいかなという感じはする

kminoda commented 4 years ago

単に足し合わせた方が良いのかIoU基準で間引いた方が良いのかいまいち判別がつかないな

Toma0916 commented 4 years ago

単に足し合わせた方が良いのかIoU基準で間引いた方が良いのかいまいち判別がつかないな

あごめん cutmixの話していた

kminoda commented 4 years ago

あ、cutmixか 単に画像から一部cutする時にbboxもろともcutすれば良いのでは?np.clip的なので

kminoda commented 4 years ago

てか普通にcutmixって明言してたなw ごめんw

Toma0916 commented 4 years ago

それでもいいんだけど、それは外側のboxでやろうとするとちょっと工夫必要な気がしている

kminoda commented 4 years ago

そもそもcutmix誤解してたかも

画像Aに画像Bの一部分を切り出して、それを画像Aの一部分と入れ替える

のかと思っていたが、ひょっとして

画像Aに画像Bの一部分を切り出して、それを画像Aの一部分に足し合わせる(mixする)

が正解?

Toma0916 commented 4 years ago

基本的には上のほう

kaggleのカーネルでは下もやってたね

Toma0916 commented 4 years ago

あたぶん理解した

kminoda commented 4 years ago

つよい

kminoda commented 4 years ago

https://github.com/clovaai/CutMix-PyTorch/issues/19 やっぱいろいろ大変っぽいな

Toma0916 commented 4 years ago

スクリーンショット 2020-05-25 15 52 39

重なりが0.5あったら(iouではない)残すやつスッキリかけた

Toma0916 commented 4 years ago

画像Aに画像Bの一部分を切り出して、それを画像Aの一部分に足し合わせる(mixする)

これも入れる?

Toma0916 commented 4 years ago

スクリーンショット 2020-05-25 15 57 10

cutmix + mixup + mosaic

Toma0916 commented 4 years ago

mixupcutmix一応動く実装になってるはず。 重ね合わせ度合いのベータ分布のハイパラは一般的なやつベタ書きした。

kminoda commented 4 years ago

カオスで草

kminoda commented 4 years ago

まあ動きますね 大丈夫そう

Toma0916 commented 4 years ago
image: a PIL Image of size (H, W)
target: a dict containing the following fields
boxes (FloatTensor[N, 4]): the coordinates of the N bounding boxes in [x0, y0, x1, y1] format, ranging from 0 to W and 0 to H
labels (Int64Tensor[N]): the label for each bounding box. 0 represents always the background class.
image_id (Int64Tensor[1]): an image identifier. It should be unique between all the images in the dataset, and is used during evaluation
area (Tensor[N]): The area of the bounding box. This is used during evaluation with the COCO metric, to separate the metric scores between small, medium and large boxes.
iscrowd (UInt8Tensor[N]): instances with iscrowd=True will be ignored during evaluation.
(optionally) masks (UInt8Tensor[N, H, W]): The segmentation masks for each one of the objects
(optionally) keypoints (FloatTensor[N, K, 3]): For each one of the N objects, it contains the K keypoints in [x, y, visibility] format, defining the object. visibility=0 means that the keypoint is not visible. Note that for data augmentation, the notion of flipping a keypoint is dependent on the data representation, and you should probably adapt references/detection/transforms.py for your new keypoint representation

ちゃんとiscrowdの0, 1やります??

Toma0916 commented 4 years ago

https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html

kminoda commented 4 years ago

まあいんじゃない? やってる人見たことないし そもそもどうやってそれ割り振るのかわからん

Toma0916 commented 4 years ago

iouとかかなって思ったけど一旦いいか

kminoda commented 4 years ago

そこでいうevaluationってlossを計算するところとかなのかな いずれにせよ最終的にはiscrowdだろうがそうでなかろうが検知しなきゃいけないわけだから、そのままで良い気がする

Toma0916 commented 4 years ago

eval_modeの時は使わんパラメタってことじゃない? ソース見てないけどtrainには効いてきそう

kminoda commented 4 years ago

まーじしましょう!!!