Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/demo_bodymocap.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def run_body_mocap(args, body_bbox_detector, body_mocap, visualizer):
# load data
load_bbox = False

if input_type =='image_dir':
if input_type in ['image', 'image_dir']:
if cur_frame < len(input_data):
image_path = input_data[cur_frame]
img_original_bgr = cv2.imread(image_path)
Expand Down
2 changes: 1 addition & 1 deletion demo/demo_frankmocap.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def run_frank_mocap(args, bbox_detector, body_mocap, hand_mocap, visualizer):
# load data
load_bbox = False

if input_type =='image_dir':
if input_type in ['image', 'image_dir']:
if cur_frame < len(input_data):
image_path = input_data[cur_frame]
img_original_bgr = cv2.imread(image_path)
Expand Down
2 changes: 1 addition & 1 deletion demo/demo_handmocap.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def run_hand_mocap(args, bbox_detector, hand_mocap, visualizer):
# load data
load_bbox = False

if input_type =='image_dir':
if input_type in ['image', 'image_dir']:
if cur_frame < len(input_data):
image_path = input_data[cur_frame]
img_original_bgr = cv2.imread(image_path)
Expand Down
7 changes: 7 additions & 0 deletions mocap_utils/demo_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def __get_input_type(args):

if extension.lower() in video_exts:
input_type ='video'
if extension.lower() in image_exts:
input_type = 'image'
elif osp.isdir(args.input_path):
file_list = os.listdir(args.input_path)
assert len(file_list) >0, f"{args.input_path} is a blank folder"
Expand Down Expand Up @@ -110,6 +112,11 @@ def setup_input(args):
cap = cv2.VideoCapture(0) #webcam input
return input_type, cap

elif input_type == 'image':
image_list = [args.input_path]
__img_seq_setup(args)
return input_type, image_list

elif input_type =='image_dir':
image_list = gnu.get_all_files(args.input_path, image_exts, "relative")
image_list = [ osp.join(args.input_path, image_name) for image_name in image_list ]
Expand Down