AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.67k stars 7.96k forks source link

What are Supported Image Formats for training YOLOv4 on Darknet Framework? #7652

Closed abuelgasimsaadeldin closed 3 years ago

abuelgasimsaadeldin commented 3 years ago

Hi, I was wondering what are the supported image formats for training a Yolov4 object detector on the Darknet Framework? I ask this question because I have not found a list of acceptable image formats and from my research online I found that Yolov4 Darknet only support jpg and jpeg format, so would just like to confirm. Thanks!

stephanecharette commented 3 years ago

What is the difference between "jpg" and "jpeg" format? Where online did you find that Darknet only supports these? What have you tried so far?

ekesdf commented 3 years ago

Well basically every normal format like JPG, PNG and there is no difference between JPG and JPEG it is just a naming thing nothing to worry about

ekesdf commented 3 years ago

Bildschirmfoto von 2021-04-27 19-55-28 well there is a screenshot of all formats darknet is able to store images in

ekesdf commented 3 years ago

If you build it with OpenCV support it can read any format supported via OpenCV

All copied from this website https://docs.opencv.org/master/d4/da8/group__imgcodecs.html

so all those formats: Windows bitmaps - .bmp, .dib (always supported) JPEG files - .jpeg, .jpg, .jpe (see the Note section) JPEG 2000 files - .jp2 (see the Note section) Portable Network Graphics - .png (see the Note section) WebP - .webp (see the Note section) Portable image format - .pbm, .pgm, .ppm .pxm, .pnm (always supported) PFM files - .pfm (see the Note section) Sun rasters - .sr, .ras (always supported) TIFF files - .tiff, .tif (see the Note section) OpenEXR Image files - .exr (see the Note section) Radiance HDR - .hdr, *.pic (always supported) Raster and Vector geospatial data supported by GDAL (see the Note section)

This is the Note Section The function determines the type of an image by the content, not by the file extension. In the case of color images, the decoded images will have the channels stored in B G R order. When using IMREAD_GRAYSCALE, the codec's internal grayscale conversion will be used, if available. Results may differ to the output of cvtColor() On Microsoft Windows OS and MacOSX, the codecs shipped with an OpenCV image (libjpeg, libpng, libtiff, and libjasper) are used by default. So, OpenCV can always read JPEGs, PNGs, and TIFFs. On MacOSX, there is also an option to use native MacOSX image readers. But beware that currently these native image loaders give images with different pixel values because of the color management embedded into MacOSX. On Linux, BSD flavors and other Unix-like open-source operating systems, OpenCV looks for codecs supplied with an OS image. Install the relevant packages (do not forget the development files, for example, "libjpeg-dev", in Debian and Ubuntu*) to get the codec support or turn on the OPENCV_BUILD_3RDPARTY_LIBS flag in CMake. In the case you set WITH_GDAL flag to true in CMake and IMREAD_LOAD_GDAL to load the image, then the GDAL driver will be used in order to decode the image, supporting the following formats: Raster, Vector. If EXIF information is embedded in the image file, the EXIF orientation will be taken into account and thus the image will be rotated accordingly except if the flags IMREAD_IGNORE_ORIENTATION or IMREAD_UNCHANGED are passed. Use the IMREAD_UNCHANGED flag to keep the floating point values from PFM image. By default number of pixels must be less than 2^30. Limit can be set using system variable OPENCV_IO_MAX_IMAGE_PIXELS