# !/usr/bin/env python
# -*- coding: utf-8 -*-
import io
import json
f = "val.json"
with io.open(f, "r", encoding="utf-8") as json_file:
file_f = json.load(json_file)
for box in file_f["shapes"]:
if box["label"].encode('utf-8') == "人体":
pass
else:
pass
需要注意示例代码中的三处 utf-8都要添加完备