|
def check_box(box, w, h):
"""检查 box 是否有效"""
x1, y1, x2, y2 = box
x1, y1, x2, y2 = int(x1 * w), int(y1 * h), int(x2 * w), int(y2 * h)
return (x2 - x1) * (y2 - y1) > 0
在 3 月份测过,同时让 cursor ,copilot 写这个函数的注释,也就是只写"""检查""",然后
cursor 生成
"""检查 box 是否有效"""
copoilot 生成
"""检查 box 是否在图片内""
于是 cursor 会员续到现在。。
刚刚再测了一次
cursor 生成
"""检查 box 是否有效"""
copilot 生成
"""检查一个边界框是否有效。""" |