假设您有两个项目,ID = # neighbors via Delaunay tesselation
tri = Delaunay(centers)
# draw centers and neighbors
fig = plt.figure(figsize=(10,10))
ax = fig.add_subplot(111)
plt.imshow(mark_boundaries(img, segments))
plt.scatter(centers[:,1],centers[:,0], c='y')
# this contains the neighbors list: tri.vertex_neighbor_vertices
indptr,indices = tri.vertex_neighbor_vertices
# draw lines from each center to its neighbors
for i in range(len(indptr)-1):
N = indices[indptr[i]:indptr[i+1]] # list of neighbor superpixels
centerA = np.repeat([centers[i]], len(N), axis=0)
centerB = centers[N]
for y0,x0,y1,x1 in np.hstack([centerA,centerB]):
l = Line2D([x0,x1],[y0,y1], alpha=0.5)
ax.add_line(l)
和engine-project-1
。
storage-project-1
有一个基本的App Engine应用程序,需要访问engine-project-1
中存储桶中的图像文件。默认情况下,拒绝storage-project-1
访问engine-project-1
您如何授予storage-project-1
中的app-engine-service角色(engine-project-1@appspot.gserviceaccount.com
)访问engine-project-1
帐户中的存储角色(roles/storage.objectViewer
)?>
答案 0 :(得分:3)
在此示例中,在storage-project-1
中运行的App Engine应用需要访问${SOURCE_PROJECT_ID}
中的构建状态。
使用为项目ID = ${GOOGLE_CLOUD_PROJECT}
激活的云外壳,可以轻松完成此操作
${GOOGLE_CLOUD_PROJECT}