Skip to content

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

Open
@gardenia06

Description

@gardenia06

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')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions