Darknet/YOLO v5.0-117-g31c55275-dirty
Object Detection Framework
 
Loading...
Searching...
No Matches
darknet_images Namespace Reference

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)
 

Function Documentation

◆ batch_detection()

darknet_images.batch_detection (   network,
  images,
  class_names,
  class_colors,
  thresh = 0.25,
  hier_thresh = .5,
  nms = .45,
  batch_size = 4 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ batch_detection_example()

darknet_images.batch_detection_example ( )
Here is the call graph for this function:

◆ check_arguments_errors()

darknet_images.check_arguments_errors (   args)
Here is the caller graph for this function:

◆ check_batch_shape()

darknet_images.check_batch_shape (   images,
  batch_size 
)
    Image sizes should be the same width and height
Here is the caller graph for this function:

◆ convert2relative()

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).
Here is the caller graph for this function:

◆ image_classification()

darknet_images.image_classification (   image,
  network,
  class_names 
)
Here is the call graph for this function:

◆ image_detection()

darknet_images.image_detection (   image_or_path,
  network,
  class_names,
  class_colors,
  thresh 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_images()

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
Here is the caller graph for this function:

◆ main()

darknet_images.main ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parser()

darknet_images.parser ( )
Here is the caller graph for this function:

◆ perform_detection()

darknet_images.perform_detection (   args,
  network,
  class_names,
  class_colors 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ prepare_batch()

darknet_images.prepare_batch (   images,
  network,
  channels = 3 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ save_annotations()

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.
Here is the call graph for this function:
Here is the caller graph for this function: