global_header+=(uint32_t)global_header_offset;//relative offset of local file header, since it begins where the global header used to begin
global_header+=fname;
//build footer
std::vector<char>footer;
footer+="PK";//first part of sig
footer+=(uint16_t)0x0605;//second part of sig
footer+=(uint16_t)0;//number of this disk
footer+=(uint16_t)0;//disk where footer starts
footer+=(uint16_t)(nrecs+1);//number of records on this disk
footer+=(uint16_t)(nrecs+1);//total number of records
footer+=(uint32_t)global_header.size();//nbytes of global headers
footer+=(uint32_t)(global_header_offset+nbytes+local_header.size());//offset of start of global headers, since global header now starts after newly written array
The `gen_wts.py` script convert a fastreid model to [.wts format](https://github.com/wang-xinyu/tensorrtx/blob/master/tutorials/getting_started.md#the-wts-content-format) file, then it will be used in [FastRT](https://github.com/JDAI-CV/fast-reid/blob/master/projects/FastRT) directly.
### Convert Environment
* Same as fastreid.
### How to Generate
This is a general example for converting fastreid to TensorRT model. We use `FastRT` to build the model with nvidia TensorRT APIs.
In this part you need to convert the pytorch model to '.wts' file using `gen_wts.py` follow instructions below.
1. Run command line below to generate the '.wts' file from pytorch model