Skip to content

Commit

Permalink
fix: cutout and crops in data augmentation of torch models
Browse files Browse the repository at this point in the history
  • Loading branch information
beniz authored and Bycob committed Apr 27, 2022
1 parent c03aa9d commit 1ef2796
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/backends/torch/torchdataaug.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ namespace dd
_uniform_real_1(0.0, 1.0), _bernouilli(0.5),
_uniform_int_rotate(0, 3)
{
if (_crop_params._crop_size > 0)
{
_cutout_params._img_width = _crop_params._crop_size;
_cutout_params._img_height = _crop_params._crop_size;
}
}

~TorchImgRandAugCV()
Expand Down
2 changes: 1 addition & 1 deletion tests/ut-torchapi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1713,7 +1713,7 @@ TEST(torchapi, service_train_object_detection_fasterrcnn)
"type\":\"ADAM\",\"test_interval\":200},\"net\":{\"batch_size\":2,"
"\"test_batch_size\":2},\"resume\":false,\"mirror\":true,\"rotate\":"
"true,\"crop_size\":224,"
"\"cutout\":0.1,\"geometry\":{\"prob\":0.1,\"persp_horizontal\":"
"\"cutout\":0.5,\"geometry\":{\"prob\":0.1,\"persp_horizontal\":"
"true,\"persp_vertical\":true,\"zoom_in\":true,\"zoom_out\":true,"
"\"pad_mode\":\"constant\"},\"noise\":{\"prob\":0.01},\"distort\":{"
"\"prob\":0."
Expand Down

0 comments on commit 1ef2796

Please sign in to comment.