Skip to content

Use FOMM offline with driving video#36

Merged
vassilispapadop merged 23 commits intomainfrom
feature/avatarify-offline
Dec 12, 2022
Merged

Use FOMM offline with driving video#36
vassilispapadop merged 23 commits intomainfrom
feature/avatarify-offline

Conversation

@vassilispapadop
Copy link
Copy Markdown
Contributor

@vassilispapadop vassilispapadop commented Jul 20, 2022

Description

Allows DOT.FOMM model to be used offline (without camera) with a given driving video.

Changelog:

Added:

  • dot/commons/pose/head_pose.py. Estimates whether desired head pose is achieved given Pitch, Roll and Yaw angles.

Updated:

  • dot/commons/model_option.py
  • dot/fomm/option.py
  • dot/dot.py
  • dot/commons/video/video_utils.py
  • dot/commons/utils.py
  • dot/commons/model_option.py

Usage:

dot -c ./configs/fomm.yaml --target /path/to/driving/video --source /path/to/source/image.png --use_video --save_folder /output/folder/

@ajndkr ajndkr added the feature New feature or request label Jul 27, 2022
@giorgiop giorgiop changed the title Feature/avatarify offline Feature/FOMM offline Aug 3, 2022
@vassilispapadop vassilispapadop marked this pull request as ready for review August 4, 2022 08:48
@ajndkr
Copy link
Copy Markdown
Member

ajndkr commented Aug 4, 2022

@vassilispapadop please update PR title.

@vassilispapadop
Copy link
Copy Markdown
Contributor Author

@vassilispapadop please update PR title.

i see that @giorgiop changed it yesterday

@ajndkr
Copy link
Copy Markdown
Member

ajndkr commented Aug 4, 2022

ah. I would still change it. we use PR titles to generate release notes.

@vassilispapadop vassilispapadop changed the title Feature/FOMM offline Use Avatarify offline with driving video Aug 4, 2022
@giorgiop giorgiop changed the title Use Avatarify offline with driving video Use FOMM offline with driving video Aug 26, 2022
Copy link
Copy Markdown
Member

@ajndkr ajndkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please document the offline usage in one of the READMEs?

Comment on lines +35 to +42
if (
idx == 33
or idx == 263
or idx == 1
or idx == 61
or idx == 291
or idx == 199
):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can define a list of these landmark indices and use if idx in landmark_list you can use an appropriate variable name here. I just used a random one as an example.

@vassilispapadop
Copy link
Copy Markdown
Contributor Author

vassilispapadop commented Nov 29, 2022

Updated README for offline usage
2dfbeb2

@vassilispapadop vassilispapadop marked this pull request as draft November 29, 2022 14:54
)
mp_drawing = mp.solutions.drawing_utils

# https://github.com/tensorflow/tfjs-models/blob/838611c02f51159afdd77469ce67f0e26b7bbb23/face-landmarks-detection/src/mediapipe-facemesh/keypoints.ts
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this link correct? I see no relation to HEAD_POSE_LANDMARKS.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajinkyaindulkar could you have a look here? google-ai-edge/mediapipe#1615
it doesn't seem to be well documented

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add this link instead?

Comment on lines +20 to +23
mp_face = mp.solutions.face_detection.FaceDetection(
model_selection=0, # model selection
min_detection_confidence=0.5, # confidence threshold
)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment for later. we should find a better solution than global initialisation here.

@vassilispapadop vassilispapadop marked this pull request as ready for review December 8, 2022 11:07
@vassilispapadop
Copy link
Copy Markdown
Contributor Author

FOMM example
fomm

@vassilispapadop
Copy link
Copy Markdown
Contributor Author

@ajinkyaindulkar @Ghassen-Chaabouni could you review? Can someone test DOT with use_cam(not possible on my local)

@ajndkr
Copy link
Copy Markdown
Member

ajndkr commented Dec 8, 2022

@ajinkyaindulkar @Ghassen-Chaabouni could you review? Can someone test DOT with use_cam(not possible on my local)

Even I won't be able to test it.

@Ghassen-Chaabouni
Copy link
Copy Markdown
Contributor

@ajinkyaindulkar @Ghassen-Chaabouni could you review? Can someone test DOT with use_cam(not possible on my local)

I will test it

@Ghassen-Chaabouni
Copy link
Copy Markdown
Contributor

There is no option for use_cam, but fomm works fine with the cam. Just tested it

@vassilispapadop vassilispapadop merged commit 8c67ee9 into main Dec 12, 2022
@vassilispapadop vassilispapadop deleted the feature/avatarify-offline branch December 12, 2022 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants