Functions | |
| batch_detection (network, images, class_names, class_colors, thresh=0.25, hier_thresh=.5, nms=.45, batch_size=4) | |
| batch_detection_example () | |
| check_arguments_errors (args) | |
| check_batch_shape (images, batch_size) | |
| convert2relative (image, bbox) | |
| image_classification (image, network, class_names) | |
| image_detection (image_or_path, network, class_names, class_colors, thresh) | |
| load_images (images_path) | |
| main () | |
| parser () | |
| perform_detection (args, network, class_names, class_colors) | |
| prepare_batch (images, network, channels=3) | |
| save_annotations (name, image, detections, class_names) | |
| darknet_images.batch_detection | ( | network, | |
| images, | |||
| class_names, | |||
| class_colors, | |||
thresh = 0.25, |
|||
hier_thresh = .5, |
|||
nms = .45, |
|||
batch_size = 4 |
|||
| ) |


| darknet_images.batch_detection_example | ( | ) |

| darknet_images.check_arguments_errors | ( | args | ) |

| darknet_images.check_batch_shape | ( | images, | |
| batch_size | |||
| ) |
Image sizes should be the same width and height

| darknet_images.convert2relative | ( | image, | |
| bbox | |||
| ) |
YOLO format uses normalized coordinates for annotation.
Args:
image: Input image (numpy array).
bbox: Bounding box in absolute coordinates (x, y, width, height).
Returns:
Tuple representing bounding box coordinates in relative format (x_rel, y_rel, w_rel, h_rel).

| darknet_images.image_classification | ( | image, | |
| network, | |||
| class_names | |||
| ) |

| darknet_images.image_detection | ( | image_or_path, | |
| network, | |||
| class_names, | |||
| class_colors, | |||
| thresh | |||
| ) |


| darknet_images.load_images | ( | images_path | ) |
If image path is given, return it directly For txt file, read it and return each line as image path In other case, it's a folder, return a list with names of each jpg, jpeg and png file

| darknet_images.main | ( | ) |


| darknet_images.parser | ( | ) |

| darknet_images.perform_detection | ( | args, | |
| network, | |||
| class_names, | |||
| class_colors | |||
| ) |


| darknet_images.prepare_batch | ( | images, | |
| network, | |||
channels = 3 |
|||
| ) |


| darknet_images.save_annotations | ( | name, | |
| image, | |||
| detections, | |||
| class_names | |||
| ) |
Files saved with image_name.txt and relative coordinates.
Args:
name: Name of the input image file.
image: Input image (numpy array).
detections: List of detected objects, each represented as (label, confidence, bbox).
class_names: List of class names.
Saves:
Text file with YOLO-style annotations for object detection.

