Skip to content

Commit

Permalink
feat(uav): bump min_std from 2. to 4. to reduce detections and run vs…
Browse files Browse the repository at this point in the history
…s after cluster for auto label
  • Loading branch information
danellecline committed Nov 19, 2024
1 parent 72253e5 commit e735f94
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions aipipeline/projects/uav/cluster_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
ENVIRONMENT = os.getenv("ENVIRONMENT") if os.getenv("ENVIRONMENT") else None


def process_mission(element):
def process_mission(element, run_vss=False):
# Data is in the format
# <path>,<tator section>,<start image>,<end image>
# /mnt/UAV/Level-1/trinity-2_20240702T153433_NewBrighton/SONY_DSC-RX1RM2,2024/07/NewBrighton,DSC00100.JPG,DSC00301.JPG
Expand Down Expand Up @@ -68,8 +68,13 @@ def process_mission(element):
"3",
"--device",
"cuda:0",
"--skip-visualization",
]

if run_vss:
vss_url = config_dict["vss"]["url"]
args.extend(["--vss-url", vss_url])

container = run_docker(
image=config_dict["docker"]["sdcat"],
name=f"sdcat-clu-{mission_name}",
Expand Down Expand Up @@ -99,14 +104,18 @@ def run_pipeline(argv=None):
options = PipelineOptions(beam_args)
conf_files, config_dict = setup_config(args.config)

run_vss = False
if '--vss' in beam_args:
run_vss = True

logger.info("Starting cluster pipeline...")
with beam.Pipeline(options=options) as p:
(
p
| "Read missions" >> beam.io.ReadFromText(args.missions)
| "Filter comments" >> beam.Filter(lambda line: not line.startswith("#"))
| "Create elements" >> beam.Map(lambda line: (line, config_dict))
| "Process missions (cluster)" >> beam.Map(process_mission)
| "Process missions (cluster)" >> beam.Map(process_mission, run_vss=run_vss)
)


Expand Down
2 changes: 1 addition & 1 deletion aipipeline/projects/uav/config/sdcat.ini
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ clahe = False
block_size = 39
# The minimum standard deviation of the detection found by the saliency detection to be considered
# Set to 0 to keep all detections. 8.0 is a good value for general detection, 5.0 is more conservative
min_std = 2.0
min_std = 4.0
# These classes are the ones that showed the best performance in hustvl/yolos-small model for general detection
;allowable_classes = person,airplane,boat,bird,kite,surfboard,dog,frisbee,horse,tennis ball,sports ball,animal
# By setting class_agnostic to True, the model will not use the class information to filter out detections
Expand Down

0 comments on commit e735f94

Please sign in to comment.