Commit 09cac702 authored by Rayyyyy's avatar Rayyyyy
Browse files

add niqe calcu and update readme info

parent b0878a53
......@@ -316,7 +316,7 @@ Model: RealESRGAN_x4plus
</div>
### 精度
本项目基于ADE20K公开数据集的val数据进行定性效果验证,首先需要对ADE20K val数据进行理,得到理后的结果图像(默认在results下).
本项目基于ADE20K公开数据集的val数据进行效果验证,需要对ADE20K val数据进行理,得到理后的结果(默认在results下).
```bash
# 执行推理
......@@ -324,10 +324,10 @@ python inference_realesrgan.py --model_path weights/RealESRGAN_x4plus.pth -n Rea
python evalution.py --root_path results
```
| NIQE | ADE20K val |
| NIQE | ADE20K |
| :------: | :------: |
| V100S | |
| Z100L | 3.7886 |
| V100S | 4.0358 |
| Z100L | 4.0314 |
## 应用场景
### 算法类别
......
......@@ -10,14 +10,17 @@ parser.add_argument('--root_path', type=str, default='results')
args = parser.parse_args()
def main():
for imgname in os.listdir(args.root_path):
res = []
for idx, imgname in enumerate(os.listdir(args.root_path)):
img_path = os.path.join(args.root_path, imgname)
# img_path = 'tests/data/baboon.png'
img = cv2.imread(img_path)
with warnings.catch_warnings():
warnings.simplefilter('ignore', category=RuntimeWarning)
niqe_result = calculate_niqe(img, 0, input_order='HWC', convert_to='y')
print(niqe_result)
res.append(niqe_result)
print('{} img: {} niqe: {}'.format(idx, img_path, niqe_result))
avg = float(sum(res)/len(res))
print('avg niqe', avg)
if __name__ == '__main__':
main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment