dmlc--dgl
afc83aa216
* Add hgat example * Add experiment * Clean code * clear the code * Add index in README * Add index in README * Add index in README * Add index in README * Add index in README * Add index in README * Change the code title and folder name * Ready to merge * Prepare for rebase and change message passing function * use git ignore to handle empty file * change file permission to resolve empty file * Change permission * change file mode * Finish Coding * working code cpu * pyg compare * Accelerate with batching * FastMode Enabled * update readme * Update README.md * refractor code * add graphsim code * modified code * few fix * Modified graphsim * Simple Model Added * Clean up code * Refractor the code for Merge * Bugfix enable gradient when train * update readme and format Co-authored-by: Chen <chesirui@3c22fbe5458c.ant.amazon.com> Co-authored-by: Tianjun Xiao <xiaotj1990327@gmail.com> Co-authored-by: Ubuntu <ubuntu@ip-172-31-4-63.ap-northeast-1.compute.internal> Co-authored-by: Ubuntu <ubuntu@ip-172-31-45-47.ap-northeast-1.compute.internal>
29 行
856 B
Python
29 行
856 B
Python
import matplotlib
|
|
import matplotlib.pyplot as plt
|
|
import numpy as np
|
|
import cv2 as cv
|
|
import os
|
|
import matplotlib.animation as manimation
|
|
|
|
matplotlib.use('agg')
|
|
|
|
# Make video can be used to visualize test data
|
|
|
|
|
|
def make_video(xy, filename):
|
|
os.system("rm -rf pics/*")
|
|
FFMpegWriter = manimation.writers['ffmpeg']
|
|
metadata = dict(title='Movie Test', artist='Matplotlib',
|
|
comment='Movie support!')
|
|
writer = FFMpegWriter(fps=15, metadata=metadata)
|
|
fig = plt.figure()
|
|
plt.xlim(-200, 200)
|
|
plt.ylim(-200, 200)
|
|
fig_num = len(xy)
|
|
color = ['ro', 'bo', 'go', 'ko', 'yo', 'mo', 'co']
|
|
with writer.saving(fig, filename, len(xy)):
|
|
for i in range(len(xy)):
|
|
for j in range(len(xy[0])):
|
|
plt.plot(xy[i, j, 1], xy[i, j, 0], color[j % len(color)])
|
|
writer.grab_frame()
|