Skip to content
DeepForgeby svx
All problems
EasyComputer Visioncv-356

Action Clip Frame Count

Problem

Compute the number of frames in an action recognition clip.

A clip of clip_seconds recorded at fps frames per second contains round(fps * clip_seconds) frames. Return that integer using round-half-up.

Hint

Adding 0.5 before truncating implements round-half-up.

Test cases

case 1
in: [30,2]
expected: 60
case 2
in: [25,1.6]
expected: 40
case 3
in: [24,0.5]
expected: 12
case 4
in: [60,0.75]
expected: 45
Starter codePython
def action_clip_frames(fps, clip_seconds):
    # Your code here
    pass

4 test cases · run your code against them in the editor