• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

georgia-tech-db / eva / 7b7f1fb3-a5eb-4998-a5bf-87c0734dafa7

pending completion
7b7f1fb3-a5eb-4998-a5bf-87c0734dafa7

Pull #732

circle-ci

Yulai Cui
import error fix
Pull Request #732: feat: OVERWRITE statement

368 of 368 new or added lines in 22 files covered. (100.0%)

9475 of 9809 relevant lines covered (96.59%)

0.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/eva/udfs/ndarray/annotate.py
1
# coding=utf-8
2
# Copyright 2018-2022 EVA
3
#
4
# Licensed under the Apache License, Version 2.0 (the "License");
5
# you may not use this file except in compliance with the License.
6
# You may obtain a copy of the License at
7
#
8
#     http://www.apache.org/licenses/LICENSE-2.0
9
#
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS,
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
# See the License for the specific language governing permissions and
14
# limitations under the License.
15
import cv2
×
16
import numpy as np
×
17
import pandas as pd
×
18

19
from eva.udfs.abstract.abstract_udf import AbstractUDF
×
20

21
color = (207, 248, 64)
×
22
thickness = 4
×
23

24

25
class Annotate(AbstractUDF):
×
26
    def setup(self):
×
27
        pass
×
28

29
    @property
×
30
    def name(self):
×
31
        return "Annotate"
×
32

33
    def forward(self, df: pd.DataFrame) -> pd.DataFrame:
×
34
        """
35
        Modify the frame to annotate the bbox on it.
36

37
         Returns:
38
             ret (pd.DataFrame): The modified frame.
39
        """
40

41
        def annotate(row: pd.Series) -> np.ndarray:
×
42
            row = row.to_list()
×
43
            frame = row[0]
×
44

45
            bboxes = row[2]
×
46

47
            for bbox in bboxes:
×
48
                x1, y1, x2, y2 = np.asarray(bbox, dtype="int")
×
49

50
                x1, y1, x2, y2 = int(x1), int(y1), int(x2), int(y2)
×
51

52
                frame = cv2.rectangle(frame, (x1, y1), (x2, y2), color, thickness)
×
53

54
                # cv2.putText(
55
                #     frame,
56
                #     label,
57
                #     (x1, y1 - 10),
58
                #     cv2.FONT_HERSHEY_SIMPLEX,
59
                #     0.9,
60
                #     color,
61
                #     thickness,
62
                # )
63

64
            return frame
×
65

66
        ret = pd.DataFrame()
×
67
        ret["annotated_frame_array"] = df.apply(annotate, axis=1)
×
68
        return ret
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc