diff --git a/ppcls/configs/ImageNet/HRNet/HRNet_W18_C.yaml b/ppcls/configs/ImageNet/HRNet/HRNet_W18_C.yaml index a5e6774111009fb3f280b014604f109ab964bdee..8d1e60815b694ab84c979f82fc86c3b5b94b85ce 100644 --- a/ppcls/configs/ImageNet/HRNet/HRNet_W18_C.yaml +++ b/ppcls/configs/ImageNet/HRNet/HRNet_W18_C.yaml @@ -77,6 +77,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/HRNet/HRNet_W30_C.yaml b/ppcls/configs/ImageNet/HRNet/HRNet_W30_C.yaml index 50bd7144d00d75fb04bed57bda70f7744cb5a843..dbcbe636eaab935c5989afc402ca1655ec00fad6 100644 --- a/ppcls/configs/ImageNet/HRNet/HRNet_W30_C.yaml +++ b/ppcls/configs/ImageNet/HRNet/HRNet_W30_C.yaml @@ -77,6 +77,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/HRNet/HRNet_W32_C.yaml b/ppcls/configs/ImageNet/HRNet/HRNet_W32_C.yaml index 62129ae8ce405735d677fef804cb939d91cb2ff4..baac1a321670069c4562ee0c809615f6325433db 100644 --- a/ppcls/configs/ImageNet/HRNet/HRNet_W32_C.yaml +++ b/ppcls/configs/ImageNet/HRNet/HRNet_W32_C.yaml @@ -77,6 +77,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/HRNet/HRNet_W40_C.yaml b/ppcls/configs/ImageNet/HRNet/HRNet_W40_C.yaml index f9af0c42215fb6016d62ff9a2532fdde4618d939..84512b02cb86f79ed84c030d9269d8e824859478 100644 --- a/ppcls/configs/ImageNet/HRNet/HRNet_W40_C.yaml +++ b/ppcls/configs/ImageNet/HRNet/HRNet_W40_C.yaml @@ -77,6 +77,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/HRNet/HRNet_W48_C.yaml b/ppcls/configs/ImageNet/HRNet/HRNet_W48_C.yaml index 51c796cf96ffd838a4f5e565238bf656722f6588..d743663d6651c4f2452ae9f637322c7ee17a7680 100644 --- a/ppcls/configs/ImageNet/HRNet/HRNet_W48_C.yaml +++ b/ppcls/configs/ImageNet/HRNet/HRNet_W48_C.yaml @@ -76,8 +76,6 @@ DataLoader: image_root: "./dataset/ILSVRC2012/" cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - - ResizeImage: - size: 224 - NormalizeImage: scale: 0.00392157 mean: [0.485, 0.456, 0.406] diff --git a/ppcls/configs/ImageNet/HRNet/HRNet_W64_C.yaml b/ppcls/configs/ImageNet/HRNet/HRNet_W64_C.yaml index 00c9fff91245b42d40e364c904dbb8c4f769ebdd..5af7712c1e0bb036a33095fff90f18504a43d40a 100644 --- a/ppcls/configs/ImageNet/HRNet/HRNet_W64_C.yaml +++ b/ppcls/configs/ImageNet/HRNet/HRNet_W64_C.yaml @@ -77,6 +77,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/Ineption/InceptionV3.yaml b/ppcls/configs/ImageNet/Ineption/InceptionV3.yaml index 66607f764cf6b47632c3f16f252c7ec4958fd64a..d04bc319c3ab3b766d9608ec01049a57fad287db 100644 --- a/ppcls/configs/ImageNet/Ineption/InceptionV3.yaml +++ b/ppcls/configs/ImageNet/Ineption/InceptionV3.yaml @@ -77,7 +77,9 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: - size: 224 + resize_short: 320 + - CropImage: + size: 299 - NormalizeImage: scale: 0.00392157 mean: [0.485, 0.456, 0.406] diff --git a/ppcls/configs/ImageNet/MobileNetV1/MobileNetV1.yaml b/ppcls/configs/ImageNet/MobileNetV1/MobileNetV1.yaml index 13184416d63c3eb6e2779349f5d6ac3386dac598..fd9a61f3bc51adb84adff6dd57f5dd9d4fc95a68 100644 --- a/ppcls/configs/ImageNet/MobileNetV1/MobileNetV1.yaml +++ b/ppcls/configs/ImageNet/MobileNetV1/MobileNetV1.yaml @@ -77,6 +77,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/MobileNetV1/MobileNetV1_x0_25.yaml b/ppcls/configs/ImageNet/MobileNetV1/MobileNetV1_x0_25.yaml index 75428a6c248915bb1e53046216ca2f58835e94e0..b2bb3f4d99afbfbecf2f3d6fd74263c1f3144936 100644 --- a/ppcls/configs/ImageNet/MobileNetV1/MobileNetV1_x0_25.yaml +++ b/ppcls/configs/ImageNet/MobileNetV1/MobileNetV1_x0_25.yaml @@ -77,6 +77,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/MobileNetV1/MobileNetV1_x0_5.yaml b/ppcls/configs/ImageNet/MobileNetV1/MobileNetV1_x0_5.yaml index b516f55409e79f6e745d9505d693f9fd3769a035..a0c2dbda14d8d7223f847257f1b3aeadb2a6fed4 100644 --- a/ppcls/configs/ImageNet/MobileNetV1/MobileNetV1_x0_5.yaml +++ b/ppcls/configs/ImageNet/MobileNetV1/MobileNetV1_x0_5.yaml @@ -77,6 +77,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/MobileNetV1/MobileNetV1_x0_75.yaml b/ppcls/configs/ImageNet/MobileNetV1/MobileNetV1_x0_75.yaml index 700f5c651f423be94066d7916a349b9576b27da5..5b41ea69792e29195f1685d15085f5f6a800372f 100644 --- a/ppcls/configs/ImageNet/MobileNetV1/MobileNetV1_x0_75.yaml +++ b/ppcls/configs/ImageNet/MobileNetV1/MobileNetV1_x0_75.yaml @@ -77,6 +77,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x0_35.yaml b/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x0_35.yaml index d18c211ae1dc366cef6de35e595c39c789ee491d..c07db1acfed5af56f053ab1e019be7380fc18247 100644 --- a/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x0_35.yaml +++ b/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x0_35.yaml @@ -24,6 +24,7 @@ Loss: Train: - CELoss: weight: 1.0 + epsilon: 0.1 Eval: - CELoss: weight: 1.0 @@ -75,6 +76,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x0_5.yaml b/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x0_5.yaml index c1ff15e2b93abe3c32e456fb53114016634be4e4..2782e358ad009898042c5a0042f838023001e0e1 100644 --- a/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x0_5.yaml +++ b/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x0_5.yaml @@ -24,6 +24,7 @@ Loss: Train: - CELoss: weight: 1.0 + epsilon: 0.1 Eval: - CELoss: weight: 1.0 @@ -75,6 +76,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x0_75.yaml b/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x0_75.yaml index fd387f001f9a46662c37531e619585180b05ed77..d2032e051fcc39461ed570948b50031b96a40957 100644 --- a/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x0_75.yaml +++ b/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x0_75.yaml @@ -24,6 +24,7 @@ Loss: Train: - CELoss: weight: 1.0 + epsilon: 0.1 Eval: - CELoss: weight: 1.0 @@ -75,6 +76,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x1_0.yaml b/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x1_0.yaml index b9072ed212ef9dd1a62774f798a5e3c4ae093d64..69f182ad4774a0fc32822eb998c84fc706965b88 100644 --- a/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x1_0.yaml +++ b/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x1_0.yaml @@ -24,6 +24,7 @@ Loss: Train: - CELoss: weight: 1.0 + epsilon: 0.1 Eval: - CELoss: weight: 1.0 @@ -75,6 +76,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x1_25.yaml b/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x1_25.yaml index 472942a7ebc0c7eaac7e615b9eae5198f56d00f6..66b96e633cec84e9f8cb8463ffda59a93f32d16d 100644 --- a/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x1_25.yaml +++ b/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x1_25.yaml @@ -24,6 +24,7 @@ Loss: Train: - CELoss: weight: 1.0 + epsilon: 0.1 Eval: - CELoss: weight: 1.0 @@ -75,6 +76,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x0_35.yaml b/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x0_35.yaml index 4312730f2eda5a1ef016385b987d12e1670cff12..e8ec411d68387b76198b081ea8246952253431be 100644 --- a/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x0_35.yaml +++ b/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x0_35.yaml @@ -24,6 +24,7 @@ Loss: Train: - CELoss: weight: 1.0 + epsilon: 0.1 Eval: - CELoss: weight: 1.0 @@ -75,6 +76,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x0_5.yaml b/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x0_5.yaml index 427a2793e354aa5ca1bba09cae62e0c9ec655bae..e0dda22cfe75cfbb669a0a92b3515238a7e143d5 100644 --- a/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x0_5.yaml +++ b/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x0_5.yaml @@ -24,6 +24,7 @@ Loss: Train: - CELoss: weight: 1.0 + epsilon: 0.1 Eval: - CELoss: weight: 1.0 @@ -75,6 +76,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x0_75.yaml b/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x0_75.yaml index 82246d4e45a214070325e20f3bed0a7cab2c0659..a8eff02228cec1676b50aeb0cb1f1bebccda95d5 100644 --- a/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x0_75.yaml +++ b/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x0_75.yaml @@ -24,6 +24,7 @@ Loss: Train: - CELoss: weight: 1.0 + epsilon: 0.1 Eval: - CELoss: weight: 1.0 @@ -75,6 +76,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x1_0.yaml b/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x1_0.yaml index f2810c678b08be3eed9ed40804eb0cc65c4fad8f..3d79e8681d05814c0b1ff7f0eb40b409f1bd568a 100644 --- a/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x1_0.yaml +++ b/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x1_0.yaml @@ -24,6 +24,7 @@ Loss: Train: - CELoss: weight: 1.0 + epsilon: 0.1 Eval: - CELoss: weight: 1.0 @@ -75,6 +76,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x1_25.yaml b/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x1_25.yaml index d42bddc0bc34db440fb314954af34eaad2bc7248..0e4d2060ee6cb06c6e107d22852aca86f254944e 100644 --- a/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x1_25.yaml +++ b/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x1_25.yaml @@ -24,6 +24,7 @@ Loss: Train: - CELoss: weight: 1.0 + epsilon: 0.1 Eval: - CELoss: weight: 1.0 @@ -75,6 +76,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/ResNet/ResNet101.yaml b/ppcls/configs/ImageNet/ResNet/ResNet101.yaml index ed1405e715dc25e8aaabd5b20457d751fda8c86e..2823bcd073dd96c3ed58a9d64aede15bbcc3b501 100644 --- a/ppcls/configs/ImageNet/ResNet/ResNet101.yaml +++ b/ppcls/configs/ImageNet/ResNet/ResNet101.yaml @@ -77,6 +77,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/ResNet/ResNet101_vd.yaml b/ppcls/configs/ImageNet/ResNet/ResNet101_vd.yaml index ab25cdccee7b91395d8d9b1cac85f2b9c0056e61..35496151e52ec889af6ad9c3026b6e8e0b48ef37 100644 --- a/ppcls/configs/ImageNet/ResNet/ResNet101_vd.yaml +++ b/ppcls/configs/ImageNet/ResNet/ResNet101_vd.yaml @@ -75,6 +75,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/ResNet/ResNet152.yaml b/ppcls/configs/ImageNet/ResNet/ResNet152.yaml index bc49c6bccddd8c39f06adec2a218e75e17123476..c654cff1cc8df9977f05b482aea67f462c9f2346 100644 --- a/ppcls/configs/ImageNet/ResNet/ResNet152.yaml +++ b/ppcls/configs/ImageNet/ResNet/ResNet152.yaml @@ -77,6 +77,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/ResNet/ResNet152_vd.yaml b/ppcls/configs/ImageNet/ResNet/ResNet152_vd.yaml index e190e68f56efec396b15b4ab5c8e9f89b167edb3..02f663d927199145ed06315177afea7ff8f5e852 100644 --- a/ppcls/configs/ImageNet/ResNet/ResNet152_vd.yaml +++ b/ppcls/configs/ImageNet/ResNet/ResNet152_vd.yaml @@ -75,6 +75,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/ResNet/ResNet18.yaml b/ppcls/configs/ImageNet/ResNet/ResNet18.yaml index 382a1a3861b5b89a931327bfc39c9864448c7f8d..da265e21539ae9731709add2441a11806439fdd4 100644 --- a/ppcls/configs/ImageNet/ResNet/ResNet18.yaml +++ b/ppcls/configs/ImageNet/ResNet/ResNet18.yaml @@ -77,6 +77,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/ResNet/ResNet18_vd.yaml b/ppcls/configs/ImageNet/ResNet/ResNet18_vd.yaml index dcc1508fd7324b2cc920431b470d9a54a5a5e08c..e4fa5613a4edfb413cd104d643ef37df031d6124 100644 --- a/ppcls/configs/ImageNet/ResNet/ResNet18_vd.yaml +++ b/ppcls/configs/ImageNet/ResNet/ResNet18_vd.yaml @@ -75,6 +75,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/ResNet/ResNet200_vd.yaml b/ppcls/configs/ImageNet/ResNet/ResNet200_vd.yaml index 84b8acf038de46a11a2d67c3a99bc50647dbaa60..04893335953b2dc88439de637fc825082c2d7feb 100644 --- a/ppcls/configs/ImageNet/ResNet/ResNet200_vd.yaml +++ b/ppcls/configs/ImageNet/ResNet/ResNet200_vd.yaml @@ -75,6 +75,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/ResNet/ResNet34.yaml b/ppcls/configs/ImageNet/ResNet/ResNet34.yaml index 07f7036eacefc73aec8183130b9617eed7cfd6c0..29935296f86b4157ebf0732b5993028333187dc1 100644 --- a/ppcls/configs/ImageNet/ResNet/ResNet34.yaml +++ b/ppcls/configs/ImageNet/ResNet/ResNet34.yaml @@ -77,6 +77,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/ResNet/ResNet34_vd.yaml b/ppcls/configs/ImageNet/ResNet/ResNet34_vd.yaml index 92f8bf3d7b8a48a2e0e2d5e9f27ebb94fd77a31f..c7b97d2b2b84900d5b72fc441501c8a84cdd5e5a 100644 --- a/ppcls/configs/ImageNet/ResNet/ResNet34_vd.yaml +++ b/ppcls/configs/ImageNet/ResNet/ResNet34_vd.yaml @@ -17,7 +17,7 @@ Global: # model architecture Arch: - name: "ResNet101_vd" + name: "ResNet34_vd" # loss function config for traing/eval process Loss: @@ -75,6 +75,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/ResNet/ResNet50.yaml b/ppcls/configs/ImageNet/ResNet/ResNet50.yaml index a55aeb4e8dafc8bc97a3de1da4674592d36aa17f..7262c7810b7b2c344b00f867042969c0609b4fa3 100644 --- a/ppcls/configs/ImageNet/ResNet/ResNet50.yaml +++ b/ppcls/configs/ImageNet/ResNet/ResNet50.yaml @@ -1,6 +1,6 @@ # global configs Global: - checkpoints: null + checkpoints: "output/ResNet50/ppcls_epoch_15" pretrained_model: null output_dir: "./output/" device: "gpu" @@ -77,6 +77,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/ResNet/ResNet50_vd.yaml b/ppcls/configs/ImageNet/ResNet/ResNet50_vd.yaml index 8d4305fa18b97f1407f5d4755f2e94bb4d721be9..bdbd7297e947d8362d4549b1c93037746c1081e8 100644 --- a/ppcls/configs/ImageNet/ResNet/ResNet50_vd.yaml +++ b/ppcls/configs/ImageNet/ResNet/ResNet50_vd.yaml @@ -75,6 +75,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/VGG/VGG11.yaml b/ppcls/configs/ImageNet/VGG/VGG11.yaml index 34648346b6c7147fc4ca0d28aafaaa2dbf333cca..f6440b16f89f9537ff1ad715acff1cff544b7b9d 100644 --- a/ppcls/configs/ImageNet/VGG/VGG11.yaml +++ b/ppcls/configs/ImageNet/VGG/VGG11.yaml @@ -75,6 +75,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/VGG/VGG13.yaml b/ppcls/configs/ImageNet/VGG/VGG13.yaml index c57081bb7ba1c4fc9b077f89e9ab7de433a2898e..36643038cdcc5e6ce68fdc65ba9c5242fd9503bf 100644 --- a/ppcls/configs/ImageNet/VGG/VGG13.yaml +++ b/ppcls/configs/ImageNet/VGG/VGG13.yaml @@ -75,6 +75,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/VGG/VGG16.yaml b/ppcls/configs/ImageNet/VGG/VGG16.yaml index 6e1c4045d8774b1f3219f4ffa496f6ce19606e28..491e4bb8c03629f26f9faef282aaa0967e02fb1e 100644 --- a/ppcls/configs/ImageNet/VGG/VGG16.yaml +++ b/ppcls/configs/ImageNet/VGG/VGG16.yaml @@ -75,6 +75,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/configs/ImageNet/VGG/VGG19.yaml b/ppcls/configs/ImageNet/VGG/VGG19.yaml index 28b5a101bbe87ac94edf6da5027310b5698a88bf..827fb63eae0bb67c0b4c85ac0732edac78c9da61 100644 --- a/ppcls/configs/ImageNet/VGG/VGG19.yaml +++ b/ppcls/configs/ImageNet/VGG/VGG19.yaml @@ -75,6 +75,8 @@ DataLoader: cls_label_path: "./dataset/ILSVRC2012/val_list.txt" transform_ops: - ResizeImage: + resize_short: 256 + - CropImage: size: 224 - NormalizeImage: scale: 0.00392157 diff --git a/ppcls/data/dataset/imagenet_dataset.py b/ppcls/data/dataset/imagenet_dataset.py index 1643042452e1a109083556a7862d6b5e9156f720..930d55fbaf91d0282cdda7c3fe6e410a9f63ce6d 100644 --- a/ppcls/data/dataset/imagenet_dataset.py +++ b/ppcls/data/dataset/imagenet_dataset.py @@ -30,13 +30,18 @@ from .common_dataset import CommonDataset class ImageNetDataset(CommonDataset): - def _load_anno(self): + def _load_anno(self, seed=None): assert os.path.exists(self._cls_path) assert os.path.exists(self._img_root) self.images = [] self.labels = [] + with open(self._cls_path) as fd: lines = fd.readlines() + if seed is not None: + np.random.RandomState(seed).shuffle(lines) + else: + np.random.shuffle(lines) for l in lines: l = l.strip().split(" ") self.images.append(os.path.join(self._img_root, l[0]))