005968dcfbd2a8f70d8ea3957c8abba60a12492d,pliers/filters/video.py,FrameSamplingFilter,_filter,#FrameSamplingFilter#,38

Before Change


            new_idx = range(int(video.fps * video.clip.duration))[::self.every]
        elif self.hertz is not None:
            interval = int(video.fps / self.hertz)
            new_idx = range(int(video.fps * video.clip.duration))[::interval]
        elif self.top_n is not None:
            import cv2
            diffs = []
            for i, img in enumerate(video.frames):
                if i == 0:
                    last = img
                    continue
                diffs.append(sum(cv2.sumElems(cv2.absdiff(last.data, img.data))))
                last = img
            new_idx = sorted(range(len(diffs)),
                             key=lambda i: diffs[i],
                             reverse=True)[:self.top_n]

        frame_index = sorted(list(set(video.frame_index).intersection(new_idx)))

        return VideoFrameCollectionStim(filename=video.filename,
                                        clip=video.clip,
                                        frame_index=frame_index)

After Change


        elif self.hertz is not None:
            interval = video.fps / float(self.hertz)
            new_idx = np.arange(0, video.n_frames, interval).astype(int)
            new_idx = list(new_idx)
        elif self.top_n is not None:
            import cv2
            diffs = []
            for i, img in enumerate(video.frames):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: tyarkoni/pliers
Commit Name: 005968dcfbd2a8f70d8ea3957c8abba60a12492d
Time: 2018-05-15
Author: quinten.mcnamara@gmail.com
File Name: pliers/filters/video.py
Class Name: FrameSamplingFilter
Method Name: _filter


Project Name: cesium-ml/cesium
Commit Name: 586b49b07574f7812101248c94d73ef1fb2a5c12
Time: 2015-11-11
Author: brettnaul@gmail.com
File Name: mltsp/predict.py
Class Name:
Method Name: add_to_predict_results_dict_classification_proba


Project Name: CamDavidsonPilon/lifelines
Commit Name: b1d839cb8e521c3cf2efaebe17082f1a9680a253
Time: 2020-05-13
Author: cam.davidson.pilon@gmail.com
File Name: experiments/working_npmle.py
Class Name:
Method Name: create_turnball_intervals