書き込みテストスレッド Part2
import threading def create_illustration(illustration_id): # イラストの生成処理を実装する # illustration_idに基づいて異なるイラストを作成する # 同時に作成するイラストの数 num_illustrations = 5 # スレッドを作成して実行する threads = [] for i in range(num_illustrations): t = threading.Thread(target=create_illustration, args=(i,)) threads.append(t) t.start() # 各スレッドの終了を待つ for t in threads: t.join() 上記 import matplotlib.pyplot as plt plt.imshow(image) plt.axis('off') # 軸を非表示にする plt.show() import matplotlib.pyplot as plt # イラスト1 plt.figure() plt.imshow(image1) plt.axis('off') # イラスト2 plt.figure() plt.imshow(image2) plt.axis('off') # イラスト3 plt.figure() plt.imshow(image3) plt.axis('off') # イラスト4 plt.figure() plt.imshow(image4) plt.axis('off') # 各イラストを表示 plt.show() NameError Traceback (most recent call last) <ipython-input-25-c60c1f11b8ac> in <cell line: 5>() 3 # イラスト1 4 plt.figure() ----> 5 plt.imshow(image1) 6 plt.axis('off') 7 NameError: name 'image1' is not defined import matplotlib.pyplot as plt # イラスト1のデータ image1 = # イラスト1のデータを代入 # イラスト1の表示 plt.figure() plt.imshow(image1) plt.axis('off') # イラスト2のデータ image2 = # イラスト2のデータを代入 # イラスト2の表示 plt.figure() plt.imshow(image2) plt.axis('off') # イラスト3のデータ image3 = # イラスト3のデータを代入 # イラスト3の表示 plt.figure() plt.imshow(image3) plt.axis('off') # イラスト4のデータ image4 = # イラスト4のデータを代入 # イラスト4の表示 plt.figure() plt.imshow(image4) plt.axis('off') # 各イラストを表示 plt.show() import numpy as np import matplotlib.pyplot as plt # イラスト1のデータ image1 = np.random.rand(100, 100, 3) # 100x100の乱数のイメージデータ # イラスト1の表示 plt.figure() plt.imshow(image1) plt.axis('off') # イラスト2のデータ image2 = np.random.rand(100, 100, 3) # 100x100の乱数のイメージデータ # イラスト2の表示 plt.figure() plt.imshow(image2) plt.axis('off') # イラスト3のデータ image3 = np.random.rand(100, 100, 3) # 100x100の乱数のイメージデータ # イラスト3の表示 plt.figure() plt.imshow(image3) plt.axis('off') # イラスト4のデータ image4 = np.random.rand(100, 100, 3) # 100x100の乱数のイメージデータ # イラスト4の表示 plt.figure() plt.imshow(image4) plt.axis('off') # 各イラストを表示 plt.show() num_illustrations = 5 image = pip("girl") for _ in range(num_illustrations): duplicate_image = duplicate(image) # duplicate_imageの処理または保存を行う image = pipe(" dog ").images[0] image3 = pipe(" girl").images[0] image import matplotlib.pyplot as plt # イラスト1の表示 plt.figure() plt.imshow(image1) plt.axis('off') plt.show() # イラスト2の表示 plt.figure() plt.imshow(image2) plt.axis('off') plt.show() # イラスト3の表示 plt.figure() plt.imshow(image3) plt.axis('off') plt.show() read.cgi ver 07.5.5 2024/06/08 Walang Kapalit ★ | Donguri System Team 5ちゃんねる