Add function to download weigths if do no exist, for each test. Add some controls in map demo.

Signed-off-by: Francesco Gatti <gattifrancesco@hotmail.it>
This commit is contained in:
Francesco Gatti
2020-03-14 17:02:07 +01:00
parent 5e0c1879bc
commit cf7fbadcd2
16 changed files with 51 additions and 2 deletions
+13
View File
@@ -20,6 +20,19 @@ bool fileExist(const char *fname) {
return true;
}
void downloadWeightsifDoNotExist(const std::string& input_bin, const std::string& test_folder, const std::string& weights_url)
{
if(!fileExist(input_bin.c_str()))
{
std::string wget_cmd = "wget " + weights_url + " -O " + test_folder + "/weights.zip";
std::string unzip_cmd = "unzip " + test_folder + "/weights.zip -d" + test_folder;
std::string rm_cmd = "rm " + test_folder + "/weights.zip";
system(wget_cmd.c_str());
system(unzip_cmd.c_str());
system(rm_cmd.c_str());
}
}
void readBinaryFile(std::string fname, int size, dnnType** data_h, dnnType** data_d, int seek, bool skipLoad)
{