From 37155bbab0123d5e8071d82f66dbfb3b816d2413 Mon Sep 17 00:00:00 2001 From: Han Xiao Date: Fri, 12 Jul 2019 14:17:16 +0800 Subject: [PATCH] fix(preprocessor-video): move sklearn dep to apply --- gnes/preprocessor/video/shotdetect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnes/preprocessor/video/shotdetect.py b/gnes/preprocessor/video/shotdetect.py index 2f3c0cf1..29a86f58 100644 --- a/gnes/preprocessor/video/shotdetect.py +++ b/gnes/preprocessor/video/shotdetect.py @@ -16,7 +16,6 @@ # pylint: disable=low-comment-ratio import numpy as np -from sklearn.cluster import KMeans from .base import BaseVideoPreprocessor from ...proto import gnes_pb2, array2blob from ..helper import get_video_frames, compute_descriptor, compare_descriptor @@ -39,6 +38,7 @@ def __init__(self, def apply(self, doc: 'gnes_pb2.Document') -> None: super().apply(doc) + from sklearn.cluster import KMeans if doc.raw_bytes: # stream_data = io.BytesIO(doc.raw_bytes)