我是 python 新手 我的问题是 imageio 和 visvis 绘制垂直线而不是像素,怎么了?
def writePic(picnum,picres):
return vv.imwrite('\picsout\pic'+str(picnum)+'.png',np.array(np.uint8(picres)))
def dothisandthat(pnum):
global rewards,reward
pictime=time.time()
tphase=pnum>4
imin=readPic(pnum)
imout=[[[255,255,255]]*len(imin[0])]*len(imin)
for i in range(len(imin)):
for j in range(len(imin[i])):
obsP=obsPixels(i,j,imin)
if tphase:
train()
fcol=find_col(obsP,pnum)
else:
fcol=random_trainer()
imout[i][j]=fcol
reward=calcRew(i,j,imin,fcol)
rewards.append(reward)
obs1,obs2,obs3,obs4,obs5=obsP
remember_recdata([*fcol,*obs1,*obs2,*obs3,*obs4,*obs5,pnum])
if True:
writePic(pnum,imout)
江户川乱折腾
相关分类