Tianxiaomo / pytorch-YOLOv4

PyTorch ,ONNX and TensorRT implementation of YOLOv4
Apache License 2.0
4.48k stars 1.49k forks source link

why use cv2.resize #410

Open njuhang opened 3 years ago

njuhang commented 3 years ago

读取图片之后是三维数据,但每次使用cv2.resize时候都变成二维数据。例如在train.py的475行里,resize之后变成二维,然后concatenate,整个model_input都变成了二维,如何再执行后面的transpose?不知道大家都是怎么运行通过的? After reading one image, it is three-dimensional data, but it becomes two-dimensional data every time CV2.resize is used. For example, in the line 475 of train.py , after cv2.resize, it becomes 2D, and then concatenate, the whole model_input has become two-dimensional. How to execute the subsequent transaction? I don't know how others run through it?

Richsheep commented 3 years ago

并没有变成二维

读取图片之后是三维数据,但每次使用cv2.resize时候都变成二维数据。例如在train.py的475行里,resize之后变成二维,然后concatenate,整个model_input都变成了二维,如何再执行后面的transpose?不知道大家都是怎么运行通过的? After reading one image, it is three-dimensional data, but it becomes two-dimensional data every time CV2.resize is used. For example, in the line 475 of train.py , after cv2.resize, it becomes 2D, and then concatenate, the whole model_input has become two-dimensional. How to execute the subsequent transaction? I don't know how others run through it?

BruceDai003 commented 3 years ago

读取图片之后是三维数据,但每次使用cv2.resize时候都变成二维数据。例如在train.py的475行里,resize之后变成二维,然后concatenate,整个model_input都变成了二维,如何再执行后面的transpose?不知道大家都是怎么运行通过的? After reading one image, it is three-dimensional data, but it becomes two-dimensional data every time CV2.resize is used. For example, in the line 475 of train.py , after cv2.resize, it becomes 2D, and then concatenate, the whole model_input has become two-dimensional. How to execute the subsequent transaction? I don't know how others run through it?

I don't think cv2.resize() would change the number of dimensions of inputs, it will only change the height and width of the input.