<commit_before># -*- coding: utf-8 -*-

"""
Video object
"""

import logging

import numpy as np
import cv2

from .utils import _mean_squared_error


logger = logging.getLogger(__name__)


class Video:

    """
    OpenCV Video.
    """

    def __init__(self, filepath, grayscale=False):
        # OpenCV VideoCapture object
        self._capture = cv2.VideoCapture(filepath)
        self.grayscale = grayscale
        self.bgmodel = None

    def __iter__(self):
        for i in self.frames:
            yield self.read_frame(number=i)<commit_msg>Add filepath attribute<commit_after># -*- coding: utf-8 -*-

"""
Video object
"""

import logging

import numpy as np
import cv2

from .utils import _mean_squared_error


logger = logging.getLogger(__name__)


class Video:

    """
    OpenCV Video.
    """

    def __init__(self, filepath, grayscale=False):
        # OpenCV VideoCapture object
        self.filepath = filepath
        self._capture = cv2.VideoCapture(filepath)
        self.grayscale = grayscale
        self.bgmodel = None

    def __iter__(self):
        for i in self.frames:
            yield self.read_frame(number=i)
{'fraction_non_alphanumeric': 0.09982486865148861, 'fraction_numerical': 0.005253940455341506, 'mean_word_length': 2.6056782334384856, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3655477', 'n_tokens_mistral': 367, 'n_tokens_neox': 345, 'n_words': 91}