Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'builtin_function_or_method' object has no attribute 'startswith' #239

Open
gardenia06 opened this issue Nov 4, 2024 · 0 comments
Open

Comments

@gardenia06
Copy link

gardenia06 commented Nov 4, 2024

I encountered this error when I was trying to following the methods in FAQs to turn the video into tensor for faster processing.

Screenshot 2024-11-04 at 6 03 44 PM

Here are my codes. May I know what I have done wrong?

    container = av.open(filepath)
    stream = container.streams.video[0]
    tensor = []
    for frame in container.decode(stream):
        frame_data = torch.from_numpy(frame.to_ndarray(format="rgb24"))
        frame_data = swapaxes(swapaxes(frame_data, 0, -1), 1, 2)
        tensor.append(frame_data)
    container.close()
    tensor_video = torch.stack(tensor, dim=0)
    
    # export pose as csv
    video_prediction = detector.detect_video(tensor_video, skip_frames = 24, data_type='tensor')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant