-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Field color labeling and decision tree #1704
base: main
Are you sure you want to change the base?
Field color labeling and decision tree #1704
Conversation
1ea3453
to
a7e02a1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to add types to all of your functions :)
@@ -0,0 +1 @@ | |||
*.dot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are missing an empty new line
@@ -0,0 +1 @@ | |||
from .generate_tree import optimize_thresholds, predict_image, save_tree_as_dot_file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, missing empty new line. Just run a uv run ruff format
in the python workspace
data_type: str | ||
|
||
|
||
def convert_pixels_BGR2bgrI(pixel_BGR): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add type info to parameters and return type
return image_bgI | ||
|
||
|
||
def optimize_thresholds(pixels_BGR, pixels_YCrCb, y, camera): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here. Tip: use Literal["top", "bottom"]
for camera
(or define an enum)
print( | ||
"ERROR: the parameter 'camera' in function 'optimize_thresholds' can only take the following values: ['top, 'bottom']" | ||
) | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please raise Errors instead of printing
identifier: str | ||
data_type: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add more specific types (Literal
or enum)
import os | ||
import cv2 | ||
import numpy as np | ||
import sys | ||
import re | ||
import tempfile | ||
import time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please separate std import (os, system, re, time) from third-party imports by newline
a7e02a1
to
ed90504
Compare
5689559
to
9c36821
Compare
Why? What?
New pipeline for automatic field color calibration:
How to Test