-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
37 lines (27 loc) · 851 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from concurrent.futures import thread
from lib.Generator import Generator
from multiprocessing import Process
def setup_processes(nft_groups = []):
processes = []
for i in range(0,thread_count):
processes.append(Process(target = process_nfts, args=(nft_groups[i], )))
return processes
def join(processes = []):
for i in range(0, len(processes)):
processes[i].join()
def start(processes = []):
for i in range(0, len(processes)):
processes[i].start()
def process_nfts(nfts = list):
for nft in nfts:
nft.populate_imgs()
nft.generate_image()
nft.generate_metadata()
G = Generator()
G.parse_permutations()
G.run()
thread_count = 4
segmented_nfts = G.split_nfts_for_processes(thread_count)
processes = setup_processes(segmented_nfts)
start(processes)
join(processes)