// dlib nets don't commit to a batch size, so just use 1 as the default
fout<<"\n# Input tensor dimensions"<<endl;
fout<<"batch_size = 1;"<<endl;
fout<<"input_batch_size = "<<N<<";"<<endl;
if(layers.back().detail_name=="input_rgb_image")
{
cout<<"WARNING: The source dlib network didn't commit to a specific input tensor size, we are using a default size of 28x28x1 which is appropriate for MNIST input. But if you are using different inputs you will need to edit the auto-generated python script to tell it your input size."<<endl;
fout<<"input_nr = 28; #WARNING, the source dlib network didn't commit to a specific input size, so we put 28 here as a default. It might not be the right value."<<endl;
fout<<"input_nc = 28; #WARNING, the source dlib network didn't commit to a specific input size, so we put 28 here as a default. It might not be the right value."<<endl;
fout<<"input_k = 3;"<<endl;
fout<<"input_num_channels = 3;"<<endl;
fout<<"input_num_rows = "<<NR<<";"<<endl;
fout<<"input_num_cols = "<<NC<<";"<<endl;
if(K!=3)
throwdlib::error("The dlib model requires input tensors with NUM_CHANNELS==3, but the dtoc command line specified NUM_CHANNELS=="+to_string(K));
throwdlib::error("The dlib model requires input tensors with NUM_ROWS=="+to_string(layers.back().attribute("nr"))+", but the dtoc command line specified NUM_ROWS=="+to_string(NR));
if(NC!=layers.back().attribute("nc"))
throwdlib::error("The dlib model requires input tensors with NUM_COLUMNS=="+to_string(layers.back().attribute("nc"))+", but the dtoc command line specified NUM_COLUMNS=="+to_string(NC));
if(K!=3)
throwdlib::error("The dlib model requires input tensors with NUM_CHANNELS==3, but the dtoc command line specified NUM_CHANNELS=="+to_string(K));
}
elseif(layers.back().detail_name=="input")
{
cout<<"WARNING: The source dlib network didn't commit to a specific input tensor size, we are using a default size of 28x28x1 which is appropriate for MNIST input. But if you are using different inputs you will need to edit the auto-generated python script to tell it your input size."<<endl;
fout<<"input_nr = 28; #WARNING, the source dlib network didn't commit to a specific input size, so we put 28 here as a default. It might not be the right value."<<endl;
fout<<"input_nc = 28; #WARNING, the source dlib network didn't commit to a specific input size, so we put 28 here as a default. It might not be the right value."<<endl;
fout<<"input_k = 1;"<<endl;
fout<<"input_num_channels = 1;"<<endl;
fout<<"input_num_rows = "<<NR<<";"<<endl;
fout<<"input_num_cols = "<<NC<<";"<<endl;
if(K!=1)
throwdlib::error("The dlib model requires input tensors with NUM_CHANNELS==1, but the dtoc command line specified NUM_CHANNELS=="+to_string(K));