forked from Zumbalamambo/tf-openpose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pose_datamaster.py
32 lines (25 loc) · 959 Bytes
/
pose_datamaster.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
import argparse
import time
import logging
from tensorpack.dataflow.remote import RemoteDataZMQ
logging.basicConfig(level=logging.DEBUG, format='[lmdb_dataset] %(asctime)s %(levelname)s %(message)s')
if __name__ == '__main__':
"""
Speed Test for Getting Input batches from other nodes
"""
parser = argparse.ArgumentParser(description='Worker for preparing input batches.')
parser.add_argument('--listen', type=str, default='tcp://0.0.0.0:1027')
args = parser.parse_args()
df = RemoteDataZMQ(args.listen)
logging.info('tcp queue start')
df.reset_state()
t = time.time()
for i, dp in enumerate(df.get_data()):
if i == 100:
break
logging.info('Input batch %d received.' % i)
if i == 0:
for d in dp:
logging.info('%d dp shape={}'.format(d.shape))
break
logging.info('Speed Test Done for 100 Batches in %f seconds.' % (time.time() - t))