Compare commits

...

4 Commits

Author SHA1 Message Date
Yexuan Wu 906bfc3bd3
Merge 89d0ed6df4 into a342efa982 2025-06-12 14:32:45 +08:00
王召德 a342efa982
Merge pull request #3619 from Juude/feature/avatar
fix english translation
2025-06-12 10:54:07 +08:00
若遗 d9cfc63302 fix english translation 2025-06-12 10:51:03 +08:00
futz12 89d0ed6df4 modified: tools/train/source/demo/ImageDatasetDemo.cpp
modified:   tools/train/source/demo/distillTrainQuant.cpp
2025-06-10 20:19:27 +08:00
3 changed files with 2 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View File

@ -64,7 +64,7 @@ public:
auto converImagesToFormat = CV::RGB;
int resizeHeight = 224;
int resizeWidth = 224;
std::vector<float> scales = {1/255.0, 1/255.0, 1/255.0};
std::vector<float> scales = {1/255.0f, 1/255.0f, 1/255.0f};
std::shared_ptr<ImageDataset::ImageConfig> config(ImageDataset::ImageConfig::create(converImagesToFormat, resizeHeight, resizeWidth, scales));
bool readAllImagesToMemory = false;
auto dataset = ImageDataset::create(pathToImages, pathToImageTxt, config.get(), readAllImagesToMemory);

View File

@ -84,7 +84,7 @@ void _train(std::shared_ptr<Module> origin, std::shared_ptr<Module> optmized, st
int resizeHeight = 224;
int resizeWidth = 224;
std::vector<float> means = {127.5, 127.5, 127.5};
std::vector<float> scales = {1/127.5, 1/127.5, 1/127.5};
std::vector<float> scales = {1/127.5f, 1/127.5f, 1/127.5f};
std::vector<float> cropFraction = {0.875, 0.875}; // center crop fraction for height and width
bool centerOrRandomCrop = false; // true for random crop
std::shared_ptr<ImageDataset::ImageConfig> datasetConfig(ImageDataset::ImageConfig::create(converImagesToFormat, resizeHeight, resizeWidth, scales, means, cropFraction, centerOrRandomCrop));