fixed some issues (#400)

* 1 动态输入
2 图像预处理和后处理和pytorch同步
3 代码格式统一

* 重新梳理代码

* tab 替换为4 space

* HRNet-Semantic-Segmentation

* update result img

* update readme

* Synchronize

* Modify some bugs
This commit is contained in:
BaofengZan 2021-02-07 03:41:16 -06:00 committed by GitHub
parent b15a45da39
commit 37f03a77c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -110,8 +110,8 @@ ILayer* convBnLeaky(INetworkDefinition *network, std::map<std::string, Weights>&
conv1->setPaddingNd(DimsHW{ p, p });
conv1->setNbGroups(g);
//IScaleLayer* bn1 = addBatchNorm2d(network, weightMap, *conv1->getOutput(0), lname + ".bn", 1e-4);
IScaleLayer* bn1 = addBatchNorm2d(network, weightMap, *conv1->getOutput(0), lname.substr(0, lname.find_last_of(".")) + bnname, 1e-3);
auto lr = network->addActivation(*bn1->getOutput(0), ActivationType::kLEAKY_RELU);
IScaleLayer* bn1 = addBatchNorm2d(network, weightMap, *conv1->getOutput(0), lname.substr(0, lname.find_last_of(".")) + bnname, 1e-5);
auto lr = network->addActivation(*bn1->getOutput(0), ActivationType::kRELU);
lr->setAlpha(0.1);
return lr;
}

View File

@ -1,13 +1,13 @@
# HRNet-Semantic-Segmentation
The Pytorch implementation is [HRNet-Semantic-Segmentation](https://github.com/HRNet/HRNet-Semantic-Segmentation). The implemented model is **HRNetV2-W18-Small-v2**
The Pytorch implementation is [HRNet-Semantic-Segmentation-v1.1](https://github.com/HRNet/HRNet-Semantic-Segmentation/tree/pytorch-v1.1). The implemented model is **HRNetV2-W18-Small-v2**
## How to Run
* 1. generate .wts
Download code and model from [HRNet-Semantic-Segmentation](https://github.com/HRNet/HRNet-Semantic-Segmentation) and config your environments.
Download code and model from [HRNet-Semantic-Segmentation-v1.1](https://github.com/HRNet/HRNet-Semantic-Segmentation/tree/pytorch-v1.1) and config your environments.
Put `demo.py` in the `YOUR_ROOT_DIR\HRNet-Semantic-Segmentation\tools ` folder, set `savewts in main()` as `True`, and run, the .wts will be generated.