Darknet

Darknet Detector Algorithm

class darknet_detector : public kwiver::vital::algo::image_object_detector

Public Functions

virtual bool check_configuration(vital::config_block_sptr config) const override

Check that the algorithm’s configuration config_block is valid

This checks solely within the provided config_block and not against the current state of the instance. This isn’t static for inheritance reasons.

Parameters:

config – The config block to check configuration of.

Returns:

true if the configuration check passed and false if it didn’t.

virtual vital::detected_object_set_sptr detect(vital::image_container_sptr image_data) const override

Find all objects on the provided image

This method analyzes the supplied image and along with any saved context, returns a vector of detected image objects.

Parameters:

image_data – the image pixels

Returns:

vector of image objects found

class priv

Darknet Trainer Algorithm

class darknet_trainer : public kwiver::vital::algo::train_detector

Darknet Training Utility Class.

Public Functions

virtual bool check_configuration(vital::config_block_sptr config) const override

Check that the algorithm’s configuration config_block is valid

This checks solely within the provided config_block and not against the current state of the instance. This isn’t static for inheritance reasons.

Parameters:

config – The config block to check configuration of.

Returns:

true if the configuration check passed and false if it didn’t.

virtual void train_from_disk(vital::category_hierarchy_sptr object_labels, std::vector<std::string> train_image_names, std::vector<vital::detected_object_set_sptr> train_groundtruth, std::vector<std::string> test_image_names, std::vector<vital::detected_object_set_sptr> test_groundtruth) override

Train a detection model given a list of images and detections

This varient is geared towards offline training.

Parameters:
  • object_labels – object category labels for training

  • train_image_list – list of train image filenames

  • train_groundtruth – annotations loaded for each image

  • test_image_list – list of test image filenames

  • test_groundtruth – annotations loaded for each image

class priv

FAQ

I am running out of memory in CUDA…

Try one or both of these suggestions: - Change the darknet/models/virat.cfg variables height,weight to smaller powers of 32 - Change the darknet/models/virat.cfg variables batch and subdivisions (make sure they are still the same)