NPE.py 文件源码

python
阅读 42 收藏 0 点赞 0 评论 0

项目:Neural-Photo-Editor 作者: ajbrock 项目源码 文件源码
def update_canvas(widget=None):
    global r, Z, res, rects, painted_rects
    if widget is None:
        widget = w
    # Update display values
    r = np.repeat(np.repeat(Z,r.shape[0]//Z.shape[0],0),r.shape[1]//Z.shape[1],1)

    # If we're letting freeform painting happen, delete the painted rectangles
    for p in painted_rects:
        w.delete(p)
    painted_rects = []

    for i in range(Z.shape[0]):
        for j in range(Z.shape[1]):
            w.itemconfig(int(rects[i,j]),fill = rb(255*Z[i,j]),outline = rb(255*Z[i,j]))

# Function to move the paintbrush
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号