ROMP icon indicating copy to clipboard operation
ROMP copied to clipboard

[simple-romp, README] Using as an module in 'video' mode

Open vivi90 opened this issue 3 years ago • 2 comments

According to the README i need to use the following code for using it as an module in 'image' mode:

#!/usr/bin/env python3

import romp

settings = romp.main.default_settings
romp_model = romp.ROMP(settings)
outputs = romp_model(cv2.imread('path/to/image.jpg'))

But if iam using it in the 'video' mode, i need to do the following:

#!/usr/bin/env python3

import romp

settings = romp.main.default_settings
settings.mode = "video"
romp_model = romp.ROMP(settings)
...
outputs = romp_model(frame_image)

According to here: https://github.com/Arthur151/ROMP/blob/4a5fecd140a3c54866c3f7e040bf0ac19d810190/simple_romp/romp/main.py#L189

My question: If ROMP get's in both cases ('video' and 'image' mode) only an single image as input, then why i need to change the mode from image to video?

vivi90 avatar Jun 24 '22 01:06 vivi90

@Arthur151 Not yet tested but if i want to use romp as an module in 'webcam' mode and using it's outputs in my script: How do i do that?

Have this code snippet but it does'nt really help: https://github.com/yanch2116/CharacterDriven-BlenderAddon/issues/20#issuecomment-1151966457

vivi90 avatar Jun 27 '22 21:06 vivi90

Hi, Vivian Yes, I think you have find the correct answer.

Setting the mode to video would allow users to use temporal optimization functions.

To use ROMP in 'webcam' mode without rendering, just for estimating SMPL parameters from webcam frame sequence, you can set up like this.

    settings = argparse.Namespace(GPU=gpu, center_thresh=0.2, input=None, mode='webcam', onnx=False,
                                  model_path=os.path.join(model_path, 'ROMP.pkl'), smpl_path=os.path.join(model_path, 'smpl_packed_info.pth'),
                                  smooth_coeff=3.0, temporal_optimize=True,
                                  show_largest=False, calc_smpl=False, render_mesh=False, show=False, show_items='mesh,tracking', renderer='sim3dr')
    romp = ROMP(settings)

Arthur151 avatar Jun 29 '22 01:06 Arthur151