Closed Toma0916 closed 4 years ago
mixup こっちはラベル重ねていいのかな
それぞれラベルの処理だけはまだしてないというか適当なんですけどどうするのがいいかな。
一応重なりの度合いみたいなパラメタはオリジナルに忠実に beta(0.5, 0.5)からサンプリングしてる
https://keisan.casio.jp/exec/system/1161228837
バランス良くさんサンプリングするなら 0.5 -> 2とかの方がいいと思うけど、薄いところにラベルつけてても意味ないしそのほうがいいんかな
最初のcutmixのは、ラベルを両方ともフルで載せているということ? (x1, y1, x2, y2)のformatなら境界でnp.clipすれば良いとかそういうことですかね
object detectionでのmixupがよくわかっていないんだけど 例えば上のやつの場合だったら、labelを0(背景)と1(小麦)で混ぜ合わせる的な感じなんですかね?
たぶんですけど 不要なboxを落としちゃう感じなんじゃないですかね
mixupは足して良さそう
3枚目もはや気持ち悪い
密だ
cutmixの方、どういう基準でラベル落とそう
不要なboxってcutmixの方か 元のkernelでは実際にtrainingでどうやってるのかわからなかったんだよな ググってもよくわからんかった
ちょっといい感じにダブってたら落とすってやつをやろうと思う
bboxのIoUで判定するということ? でも同じbboxでも小麦の向きによって同じと判定するべきか別々で判定するべきか変わってきそうだよな
iou的なサムシングでいいかなという感じはする
単に足し合わせた方が良いのかIoU基準で間引いた方が良いのかいまいち判別がつかないな
単に足し合わせた方が良いのかIoU基準で間引いた方が良いのかいまいち判別がつかないな
あごめん cutmixの話していた
あ、cutmixか 単に画像から一部cutする時にbboxもろともcutすれば良いのでは?np.clip的なので
てか普通にcutmixって明言してたなw ごめんw
それでもいいんだけど、それは外側のboxでやろうとするとちょっと工夫必要な気がしている
そもそもcutmix誤解してたかも
画像Aに画像Bの一部分を切り出して、それを画像Aの一部分と入れ替える
のかと思っていたが、ひょっとして
画像Aに画像Bの一部分を切り出して、それを画像Aの一部分に足し合わせる(mixする)
が正解?
基本的には上のほう
kaggleのカーネルでは下もやってたね
あたぶん理解した
つよい
https://github.com/clovaai/CutMix-PyTorch/issues/19 やっぱいろいろ大変っぽいな
重なりが0.5あったら(iouではない)残すやつスッキリかけた
画像Aに画像Bの一部分を切り出して、それを画像Aの一部分に足し合わせる(mixする)
これも入れる?
cutmix + mixup + mosaic
mixup
とcutmix
一応動く実装になってるはず。
重ね合わせ度合いのベータ分布のハイパラは一般的なやつベタ書きした。
カオスで草
まあ動きますね 大丈夫そう
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やります??
まあいんじゃない? やってる人見たことないし そもそもどうやってそれ割り振るのかわからん
iouとかかなって思ったけど一旦いいか
そこでいうevaluationってlossを計算するところとかなのかな いずれにせよ最終的にはiscrowdだろうがそうでなかろうが検知しなきゃいけないわけだから、そのままで良い気がする
eval_modeの時は使わんパラメタってことじゃない? ソース見てないけどtrainには効いてきそう
まーじしましょう!!!
cutmix ラベル落としのロジックどうしよ