first commit
This commit is contained in:
commit
54ccfb11fe
218 files changed
+19525
No files matched your search
@@ -0,0 +1,39 @@
|
||||
import json ,argparse
|
||||
import matplotlib.pyplot as plt
|
||||
import ast
|
||||
import ast
|
||||
import numpy,re
|
||||
|
||||
|
||||
path = ""
|
||||
parser1 = argparse.ArgumentParser(description="web")
|
||||
parser1.add_argument("InJsonPath", default='', type=str,
|
||||
help='InJsonPath.')
|
||||
parser1.add_argument("ImagePath", default='', type=str,
|
||||
help='ImagePath.')
|
||||
args = parser1.parse_args()
|
||||
print(args)
|
||||
|
||||
with open(args.InJsonPath,'r',encoding='utf8')as fp:
|
||||
json_data = json.load(fp)
|
||||
num_display = float(json_data["sum"])
|
||||
density = json_data["density"]
|
||||
# density = re.sub('\s+', ',', density)
|
||||
# density.replace("\[,","[")
|
||||
#density1 = ast.literal_eval(density)
|
||||
density.replace("\[","").replace("\]","")
|
||||
print(len(density))
|
||||
print(density)
|
||||
print("1 is ",type(density))
|
||||
#print("2 is ", type(density1))
|
||||
|
||||
exit()
|
||||
# print('这是文件中的json数据:',json_data)
|
||||
# print('这是读取到文件数据的数据类型:', type(json_data))
|
||||
plt.figure(num_display)
|
||||
plt.title("predict:{}".format(int(num_display)))
|
||||
plt.imshow(density)
|
||||
#print(density)
|
||||
plt.savefig(args.ImagePath)
|
||||
print("save is ok")
|
||||
plt.close()
|
||||
Reference in new issue
Block a user