小编Yas*_*ala的帖子

TypeError: function takes exactly 4 arguments (2 given) in cv2.rectangle function

I know all the solutions on the internet say to give integer co-ordinates but that isn't working for me.

def box(x,y,w,h):
    print(x,y,w,h)
    print(type(x),type(y),type(w),type(h))
    cv2.rectangle(image, (int(x),int(y)) , (int(x+w),int(y+h)) , (255,0,0) , 2.0) ----> error

for i in indices.flatten():
    x,y,w,h = boxes[i][0],boxes[i][1],boxes[i][2],boxes[i][3]
    box(int(x),int(y),int(w),int(h))    
Run Code Online (Sandbox Code Playgroud)

Output of debug

414 1308 53 404
<class 'int'> <class 'int'> <class 'int'> <class 'int'>
Run Code Online (Sandbox Code Playgroud)

Python version - 3.7.0 OpenCv version - 4.4.0.42

python opencv

10
推荐指数
1
解决办法
6470
查看次数

无法在 Kaggle 笔记本中安装 Python 库

当我!pip install 'library_name' 在 kaggle 控制台中运行时,它会抛出此警告:

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) 
after connection broken by 'NewConnectionError('
<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fc7bd22aed0>:
Failed to establish a new connection: [Errno -3] Temporary failure in name resolution
')': /simple/pip/
Run Code Online (Sandbox Code Playgroud)

最终不安装该库。

这个警告的原因是什么以及如何解决这个问题?

python kaggle

7
推荐指数
1
解决办法
4497
查看次数

标签 统计

python ×2

kaggle ×1

opencv ×1