Skip to main content

An educational module for experimenting with single-instance and multi-instance object detection and for generating region proposals with graph-based algorithms

Project description

Consult the module API page at

https://engineering.purdue.edu/kak/distRPG/RegionProposalGenerator-2.0.2.html

for all information related to this module, including information related to the latest changes to the code. The page at the URL shown above lists all of the module functionality you can invoke in your own code.

Single-Instance and Multi-Instance Object Detection:

    Say you wish to experiment with YOLO-like logic for multi-instance
    object detection, you would need to construct an instance of the
    RegionProposalGenerator class and invoke the methods shown below on
    this instance:

    rpg = RegionProposalGenerator(
                      dataroot = "./data/",
                      image_size = [128,128],
                      yolo_interval = 20,
                      path_saved_yolo_model = "./saved_yolo_model",
                      momentum = 0.9,
                      learning_rate = 1e-6,
                      epochs = 40,
                      batch_size = 4,
                      classes = ('Dr_Eval','house','watertower'),
                      use_gpu = True,
                  )
    yolo = RegionProposalGenerator.YoloLikeDetector( rpg = rpg )
    yolo.set_dataloaders(train=True)
    yolo.set_dataloaders(test=True)
    model = yolo.NetForYolo(skip_connections=True, depth=8)
    model = yolo.run_code_for_training_multi_instance_detection(model, display_images=False)
    yolo.run_code_for_training_multi_instance_detection(model, display_images = True)


Graph-Based Algorithms for Region Proposals:

    To generate region proposals, you would need to construct an instance
    of the RegionProposalGenerator class and invoke the methods shown below
    on this instance:

    rpg = RegionProposalGenerator(
                   ###  The first 6 options affect only the graph-based part of the algo
                   sigma = 1.0,
                   max_iterations = 40,
                   kay = 0.05,
                   image_normalization_required = True,
                   image_size_reduction_factor = 4,
                   min_size_for_graph_based_blobs = 4,
                   ###  The next 4 options affect only the Selective Search part of the algo
                   color_homogeneity_thresh = [20,20,20],
                   gray_var_thresh = 16000,
                   texture_homogeneity_thresh = 120,
                   max_num_blobs_expected = 8,
          )

    image_name = "images/mondrian.jpg"
    segmented_graph,color_map = rpg.graph_based_segmentation(image_name)
    rpg.visualize_segmentation_in_pseudocolor(segmented_graph[0], color_map, "graph_based" )
    merged_blobs, color_map = rpg.selective_search_for_region_proposals( segmented_graph, image_name )
    rpg.visualize_segmentation_with_mean_gray(merged_blobs, "ss_based_segmentation_in_bw" )

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

RegionProposalGenerator-2.0.2.tar.gz (368.0 kB view details)

Uploaded Source

File details

Details for the file RegionProposalGenerator-2.0.2.tar.gz.

File metadata

  • Download URL: RegionProposalGenerator-2.0.2.tar.gz
  • Upload date:
  • Size: 368.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.4.2 requests/2.23.0 setuptools/49.3.1 requests-toolbelt/0.8.0 tqdm/4.48.2 CPython/3.8.6

File hashes

Hashes for RegionProposalGenerator-2.0.2.tar.gz
Algorithm Hash digest
SHA256 dccc3ea1065bc934289101ceedde235c8ebd872c720c5cd3f4c1cdf3340e2186
MD5 2017361ac6896cea5ab8a46562c8c1a2
BLAKE2b-256 9de1b98feafe6856bff0cf09a40592645811f93bf6d276f1f14be92e172cda9e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page