twanghcmut's picture
download
raw
641 Bytes
# -*- coding: utf-8 -*-
# Copyright (c) Alibaba, Inc. and its affiliates.
import cv2
import numpy as np
from .utils import convert_to_numpy
class GrayAnnotator:
def __init__(self, cfg):
pass
def forward(self, image):
image = convert_to_numpy(image)
gray_map = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
return gray_map[..., None].repeat(3, axis=2)
class GrayVideoAnnotator(GrayAnnotator):
def forward(self, frames):
ret_frames = []
for frame in frames:
anno_frame = super().forward(np.array(frame))
ret_frames.append(anno_frame)
return ret_frames

Xet Storage Details

Size:
641 Bytes
·
Xet hash:
ab65f713994ab66bc736e6df6385dda53fe67e83abbc2b018d661cb54f02f16e

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.