途中で使ったpythonのコードは https://colab.research.google.com/drive/1hOuL44PgnIgLj1DbZBKFOgrIXGTGmmC3?usp=sharing こちらです。