Object Detection
Loading...
Searching...
No Matches
Functions | Variables
get_masks Namespace Reference

Functions

 extract_colored_class_masks (results, output_dir=None, image_name=None, class_colors=None)
 

Variables

str model_path = "/home/seame/ObjectDetectionAvoidance/models/yolo-object-lane-unfroze/weights/last.pt"
 
 model = YOLO(model_path)
 
str folder_path = "/home/seame/seame_road"
 
str output_dir = "/home/seame/ObjectDetectionAvoidance/masks_last_conf"
 
dict custom_colors
 
 file_path = os.path.join(folder_path, file_name)
 
 results = model.predict(file_path, conf=0.1, imgsz=320)
 
 image_name = os.path.splitext(os.path.basename(file_path))[0]
 
 colored_mask = extract_colored_class_masks(results, output_dir, image_name, class_colors=custom_colors)
 

Function Documentation

◆ extract_colored_class_masks()

get_masks.extract_colored_class_masks (   results,
  output_dir = None,
  image_name = None,
  class_colors = None 
)

Variable Documentation

◆ colored_mask

get_masks.colored_mask = extract_colored_class_masks(results, output_dir, image_name, class_colors=custom_colors)

◆ custom_colors

dict get_masks.custom_colors
Initial value:
1= {
2 3: (0, 0, 255), # 'lane' -> Blue
3 12: (255, 0, 0), # 'car' -> Red
4 }

◆ file_path

get_masks.file_path = os.path.join(folder_path, file_name)

◆ folder_path

str get_masks.folder_path = "/home/seame/seame_road"

◆ image_name

get_masks.image_name = os.path.splitext(os.path.basename(file_path))[0]

◆ model

get_masks.model = YOLO(model_path)

◆ model_path

str get_masks.model_path = "/home/seame/ObjectDetectionAvoidance/models/yolo-object-lane-unfroze/weights/last.pt"

◆ output_dir

str get_masks.output_dir = "/home/seame/ObjectDetectionAvoidance/masks_last_conf"

◆ results

get_masks.results = model.predict(file_path, conf=0.1, imgsz=320)