Skip to content

Reshape Error  #43

@Ashleydai2003

Description

@Ashleydai2003

When trying to produce a hash for certain videos (example: https://www.youtube.com/watch?v=B4UIO3dDa2w), the function fails with the following error. Not sure what is causing the problem or how to amend it.

ValueError                                Traceback (most recent call last)
<ipython-input-41-96e101e5397b> in <cell line: 2>()
      1 # do we only want to produce hash if both are videos? or produce hash for any video file?
      2 if (is_video1):
----> 3   hash1 = hasher.compute(path1, hash_format="vector")
      4 if (is_video2):
      5   hash2 = hasher.compute(path2, hash_format="vector")

1 frames
[/usr/local/lib/python3.10/dist-packages/perception](https://colab.research.google.com/drive/1iPV9A4vj7i9pTSH2ePRSxvIf4yf2-b9w#)[/hashers/video/tmk.py](https://colab.research.google.com/drive/1iPV9A4vj7i9pTSH2ePRSxvIf4yf2-b9w#) in hash_from_final_state(self, state)
     74         timestamps = np.array(state["timestamps"])
     75         # pylint: disable=unsubscriptable-object
---> 76         features = np.array(state["features"]).reshape(
     77             (1, 1, timestamps.shape[0], self.frame_hasher.hash_length)
     78         )

ValueError: cannot reshape array of size 983 into shape (1,1,983,255)

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