-
Notifications
You must be signed in to change notification settings - Fork 2
Add bounding box annotations #30
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
Open
BaileyJoe
wants to merge
11
commits into
main
Choose a base branch
from
bailey/bboxes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f164f54
ball radius
ysims d5019da
bbox config
ysims 7f6299f
vis tool
ysims e900e82
create and save annotations
ysims 2636a83
balls working?
ysims e01fdef
ball and robots good
ysims 2582a4e
YES
ysims 3969858
some info
ysims df0a70a
.
ysims 284cd7e
mostly equisolid projection
BaileyJoe dfc1015
added check for occluded balls
BaileyJoe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,3 +127,14 @@ The HDR JSON metadata file may have the following fields: | |
| ``` | ||
|
|
||
| </details> | ||
|
|
||
|
|
||
| ## BOUNDING BOX STUFF | ||
|
|
||
| The current bounding box implementation in this branch does not integrate well with the segmentation side. The HDR must have blobs on the intersections in the following colours: | ||
|
|
||
| - L: magenta [255, 0, 255] | ||
| - T: cyan [0, 255, 255] | ||
| - X: darker orange [255, 100, 0] | ||
|
|
||
| The goal posts must be solid yellow [255, 255, 0] with just the posts and not the top bar or any other part of the goals. | ||
|
Comment on lines
+134
to
+140
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be better to get the positions given we know field dimensions. |
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -366,8 +366,51 @@ def main(): | |
| os.path.join(out_cfg.depth_dir, filename) + ".exr", | ||
| ) | ||
|
|
||
| # Check that the rotation matrix of the main camera is valid | ||
| print(f"Rotation matrix of {cam_l.obj.name}: \n", cam_l.obj.matrix_world) | ||
| ############################################## | ||
| ## BOUNDING BOX GENERATION ## | ||
| ############################################## | ||
|
|
||
| annotations = [] | ||
|
|
||
| # Ball annotations | ||
| ball_annotations = [util.write_annotations(ball.obj)] | ||
| annotations += [ann for ann in ball_annotations if ann is not None] | ||
|
|
||
| # Goal annotations | ||
| # goal_annotations = [util.write_annotations(goal.obj, 1) for goal in goals] | ||
| # annotations += [ann for ann in goal_annotations if ann is not None] | ||
|
Comment on lines
+379
to
+381
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't leave in commented out code |
||
|
|
||
| # Goal post annotations (from rendered segmentation mask) | ||
| rendered_mask_path = os.path.join(out_cfg.mask_dir, "{}.png".format(filename)) | ||
| goalpost_annotations = util.write_goal_post_annotations_from_mask( | ||
| rendered_mask_path, bpy.context.scene | ||
| ) | ||
| annotations += goalpost_annotations | ||
|
|
||
| # Robot annotations (exclude the camera robot r0) | ||
| robot_annotations = [util.write_annotations(robot.obj, 2) for robot in robots[1:]] # Skip robots[0] which is the camera robot | ||
| annotations += [ann for ann in robot_annotations if ann is not None] | ||
|
|
||
| # Misc robot annotations | ||
| misc_annotations = [util.write_annotations(misc_robot.obj, 2) for misc_robot in misc_robots] | ||
| annotations += [ann for ann in misc_annotations if ann is not None] | ||
|
|
||
| # Intersection annotations (from rendered segmentation mask) | ||
| intersection_annotations = util.write_intersection_annotations_from_mask( | ||
| rendered_mask_path, bpy.context.scene | ||
| ) | ||
| annotations += intersection_annotations | ||
|
|
||
| # Write YOLO format annotations | ||
| if annotations: | ||
| os.makedirs(out_cfg.output_dir + "/annotations", exist_ok=True) | ||
| annotation_file = os.path.join(out_cfg.output_dir + "/annotations", f"{filename}.txt") | ||
| with open(annotation_file, 'w') as f: | ||
| for ann in annotations: | ||
| f.write(f"{ann[0]} {ann[1]:.6f} {ann[2]:.6f} {ann[3]:.6f} {ann[4]:.6f}\n") | ||
| print(f"[INFO] Wrote {len(annotations)} annotations to {annotation_file}") | ||
| else: | ||
| print(f"[INFO] No annotations generated for frame {filename}") | ||
|
|
||
| # Generate meta file | ||
| with open( | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
better heading