Skip to content

Commit

Permalink
Updating some thresholds in manage_local_batch to play nicely with MDv5
Browse files Browse the repository at this point in the history
  • Loading branch information
agentmorris committed Jun 27, 2022
1 parent f70072b commit 82d2c45
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions api/batch_processing/data_preparation/manage_local_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def split_list(L, n):
options.include_almost_detections = True
options.num_images_to_sample = 7500
options.parallelize_rendering_n_cores = n_rendering_threads
options.confidence_threshold = 0.8
options.confidence_threshold = 0.2
options.almost_detection_confidence_threshold = options.confidence_threshold - 0.05
options.ground_truth_json_file = None
options.separate_detections_by_category = True
Expand Down Expand Up @@ -542,7 +542,7 @@ def remove_overflow_folders(relativePath):
options.parallelize_rendering = True
options.include_almost_detections = True
options.num_images_to_sample = 7500
options.confidence_threshold = 0.8
options.confidence_threshold = 0.2
options.almost_detection_confidence_threshold = options.confidence_threshold - 0.05
options.ground_truth_json_file = None
options.separate_detections_by_category = True
Expand Down Expand Up @@ -922,7 +922,10 @@ def remove_overflow_folders(relativePath):
from api.batch_processing.postprocessing import categorize_detections_by_size

options = categorize_detections_by_size.SizeCategorizationOptions()

# This is a size threshold, not a confidence threshold
options.threshold = 0.85

input_file = r"g:\organization\file.json"
size_separated_file = input_file.replace('.json','-size-separated-{}.json'.format(options.threshold))
d = categorize_detections_by_size.categorize_detections_by_size(input_file,size_separated_file,options)
Expand Down Expand Up @@ -954,7 +957,7 @@ def remove_overflow_folders(relativePath):
output_filename))

options = SubsetJsonDetectorOutputOptions()
options.confidence_threshold = 0.4
options.confidence_threshold = 0.01
options.overwrite_json_files = True
options.make_folder_relative = True
options.query = folder_name + '\\'
Expand Down Expand Up @@ -983,7 +986,7 @@ def remove_overflow_folders(relativePath):
from api.batch_processing.postprocessing.separate_detections_into_folders import (
separate_detections_into_folders, SeparateDetectionsIntoFoldersOptions)

default_threshold = 0.8
default_threshold = 0.2
base_output_folder = r'e:\{}-{}-separated'.format(base_task_name,default_threshold)

options = SeparateDetectionsIntoFoldersOptions(default_threshold)
Expand Down Expand Up @@ -1015,7 +1018,7 @@ def remove_overflow_folders(relativePath):
options.parallelize_rendering = True
options.include_almost_detections = True
options.num_images_to_sample = 10000
options.confidence_threshold = 0.75
options.confidence_threshold = 0.2
options.classification_confidence_threshold = 0.75
options.almost_detection_confidence_threshold = options.confidence_threshold - 0.05
options.ground_truth_json_file = None
Expand Down

0 comments on commit 82d2c45

Please sign in to comment.