py-feat icon indicating copy to clipboard operation
py-feat copied to clipboard

'builtin_function_or_method' object has no attribute 'startswith'

Open gardenia06 opened this issue 1 year ago • 0 comments

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

gardenia06 avatar Nov 04 '24 10:11 gardenia06