DarkMark  v1.8.20-1
Image markup for darknet machine learning.
Looking for a C++ dev who knows OpenCV?
I'm looking for work. Hire me!
Images

The "images" options control how DarkMark handles annotated images when creating the Darknet project files.

The examples below reference this 1600x1200 source image:

Do Not Resize Images

When you select "do not resize images", the images and annotations will be passed as-is to Darknet, regardless of the network dimensions. This means Darknet itself will be responsible for any necessary resizing of images required during training.

Note that this is the slowest training option, as Darknet must continuously resize all of the images as they are loaded from disk. Darknet does not keep a local image cache.

Using the image above as an example – regardless of the configuration type or network dimensions – the image given to Darknet for training will measure 1600x1200.

Note
When resizing images, Darknet does not maintain or respect aspect ratio. All images will be stretched as necessary to match the exact network dimensions defined in the "[net]" section of the cfg file.

Resize Images

When you select "resize images", DarkMark will auto-resize all of the images as it prepares the Darknet files. For example, if the network measures 416x416, the original 1600x1200 image above will be stretched to match the exact network dimensions. Similarly to the previous option, this does not attempt to maintain the aspect ratio.

All image annotations are maintained when images are resized.

This image option can be combined with the other tile and crop/zoom options.

Tile Images

When you select "tile images", DarkMark will split any large images into individual tiles. This is discussed further in Image Size and Tiling.

The image tiles are the same aspect ratio as the network dimensions, so the images are not distorted when tiled.

The coordinates of all image annotations are automatically fixed by DarkMark during this process. Only annotations appearing on the tile are exported.

This image option can be combined with the other resize and crop/zoom options.

Given a 416x416 network, the original 1600x1200 image may be split like this:

Crop & Zoom Images

When you select "crop & zoom images", DarkMark will choose random regions of large images, crop those regions to create several new images, and then zoom the new images to match the exact network dimensions. This is similar to the previous option, but it doesn't guarantee 100% coverage as the regions and zoom levels are random, and the relative size of the annotated objects will change.

The cropped regions are always the same aspect ratio as the network dimensions, so the image is not distorted when it is resized.

The coordinates of all image annotations are automatically fixed by DarkMark during this process. Only annotations appearing on the new output image are exported.

This image option can be combined with the other resize and tiling options.

Image Cache

When the previous "images" options are used in DarkMark to resize or tile images for network training, DarkMark automatically creates a subdirectory called darkmark_image_cache. DarkMark knows to ignore this directory when annotating images, or showing annotated images.

Once training has completed, this directory containing images and Darknet annotation txt files may be deleted to recover disk space.