[~] Refactor
This commit is contained in:
parent
ad79a243d3
commit
ef2ee038cc
@ -1155,7 +1155,7 @@ def kernel_15(
|
||||
]
|
||||
)
|
||||
|
||||
def kernel_16():
|
||||
def kernel_16(images):
|
||||
import argparse
|
||||
import os
|
||||
import platform
|
||||
@ -1178,3 +1178,53 @@ def kernel_16():
|
||||
from alphapose.utils.vis import getTime
|
||||
from alphapose.utils.webcam_detector import WebCamDetectionLoader
|
||||
from alphapose.utils.writer import DataWriter
|
||||
|
||||
t2 = '/kaggle/working/test-input'
|
||||
subprocess.check_call([
|
||||
'rm',
|
||||
'-fr',
|
||||
t2,
|
||||
])
|
||||
|
||||
subprocess.check_call([
|
||||
'mkdir',
|
||||
'-p',
|
||||
t2,
|
||||
])
|
||||
|
||||
t1 = []
|
||||
for i, o in enumerate(images):
|
||||
t2 = cv2.cvtColor(o, cv2.COLOR_RGB2BGR)
|
||||
t3 = 'image-%d.jpg' % i
|
||||
cv2.imwrite(t3, t2)
|
||||
t1.append(
|
||||
dict(
|
||||
image_name=t3,
|
||||
image_canvas=o,
|
||||
image_index=i,
|
||||
)
|
||||
)
|
||||
|
||||
t4 = '/kaggle/working/test-output'
|
||||
subprocess.check_call([
|
||||
'rm',
|
||||
'-fr',
|
||||
t4,
|
||||
])
|
||||
|
||||
subprocess.check_call([
|
||||
'mkdir',
|
||||
'-p',
|
||||
t4,
|
||||
])
|
||||
|
||||
assert os.system(r'''
|
||||
cd /kaggle/working/AlphaPose &&
|
||||
python3 \
|
||||
scripts/demo_inference.py \
|
||||
--cfg configs/coco/resnet/256x192_res50_lr1e-3_1x.yaml \
|
||||
--checkpoint pretrained_models/fast_res50_256x192.pth \
|
||||
--indir %s \
|
||||
--outdir %s \
|
||||
--save_img
|
||||
''' % (t2, t4)) == 0
|
||||
|
Loading…
Reference in New Issue
Block a user