Bootcamp Reviewers

Overview

This guide is for reviewers of bootcamp submissions.

If you are a bootcamper, please close this page and go to the bootcamp.

Members who wish to become bootcamp reviewers, please complete the bootcamp in full (with PR accepted) before continuing.

PR review

Comments

If the bootcamper omitted something required or has done something that is not allowed in this guide, they must fix their code.

  • Normal PR review comment.

Unideal: The bootcamper does not need to change anything.

  • Add (You do not need to change anything here, just something to think about). after your PR review comment.

If you see something particularly good, add a comment!

  • Add (You do not need to change anything here). as well to prevent confusion.

Completion

Once the bootcamper’s submission is accepted, add your review:

  1. Under the title on the right, click Files changed.

  2. On the right, click the green Review changes dropdown.

  3. Write LGTM. .

  4. Ensure the Comment option is selected, DO NOT SELECT APPROVE.

  5. Click the green Submit review.

  6. Under the title, click Conversation.

  7. Scroll to the bottom and close the PR.

  8. Send this message in the bootcamper’s Discord thread: You've completed the bootcamp! Please follow the new member onboarding procedure: https://uwarg-docs.atlassian.net/wiki/spaces/AD/pages/1697349760 . Please join Autonomy meetings which are every week on [day] at [time]!

    1. Replace [day] and [time] with the appropriate day of the week and time respectively.

  9. Remove the New Bootcamper role from the new member (if you are not a lead, ping the Autonomy leads to do this).

Coding style

The bootcamper must follow the Python style guide: Python Style Convention . At the very least, naming and spacing convention needs to be followed.

Type hints are not explicitly required but are good to see!

Floating point comparisons

The bootcamper must not use == or != operators with floating point values. An alternative is to use a tolerance: abs(a - b) < tolerance .

  • __eq__() in DroneReport and Location is a trap. This is to teach that not all APIs should be used.

Using the operators >= , > , < , and <= are fine.

No raised exceptions

The bootcamper must not raise any exceptions at runtime. Any assertions must only be for quieting the linter and must be impossible to encounter at runtime. For example:

if not result: # return/continue/break # This will never be False because of the above assert result

Commented out and unreachable code

The bootcamper must not leave any commented out code nor unreachable code. It must be deleted.

This occurs because the bootcamper has a habit of information hoarding: What if the code is needed again? But since Git and GitHub are used for version control, it is discouraged.

Pythonic expressions

The bootcamper must use Pythonic expressions wherever possible.

Iterating

Prefer:

for thing in things: # Where `things` is iterable (e.g. list, tuple, dictionary) do_something(thing)

Instead of:

for i in range(0, len(things)): do_something(things[i])

Tuple assignment

Prefer:

Instead of:

Private members and methods

The bootcamper must not access private members and/or methods outside of the scope it is declared.

Bootcamp specific

The bootcamper must keep code changes within the designated markers:

Changing or adding code outside of the designated markers is not allowed, except for adding new helper methods within the class in task 3 and task 4.

The bootcamper must not import any additional libraries.

Task 1

ChatGPT will get most of the way there, but does not actually provide a working solution with the loop.

Relevant Ultralytics documentation: Predict

Relevant verbosity documentation: Hide Ultralytics' Yolov8 model.predict() output from terminal

Sample solution:

The bootcamper must use the predict() method and not the () operator.

  • This is not allowed: predictions = self.__model(source=...)

The arguments can be magic numbers or class constants. Global constants must not be used.

The bootcamper must set all 4 arguments.

  • conf must be within 0.4 and 0.8 (inclusive).

predictions is a list[Results] , where len(predictions) is 1 (as 1 image is passed in).

Sample solution:

Just get the Results object.

Sample solution:

The arguments can be magic numbers or class constants. Global constants must not be used.

The bootcamper must use conf=True .

image_annotated is a np.ndarray of the same shape as the input image. The logged image is annotated with the bounding boxes and confidence labels.

Sample solution:

Get the Boxes object and then the bounds in xyxy form.

boxes_xyxy is a Pytorch tensor in the GPU memory of shape (n, 4) , where n is the number of detections from the image.

Sample solution:

Chained methods:

  • detach() : Removes gradient information from the Pytorch tensor in the GPU memory.

  • cpu() : Moves the Pytorch tensor into CPU memory.

  • numpy() : Converts the Pytorch tensor into a numpy array.

boxes_cpu is a numpy array of shape (n, 4) , where n is the number of detections from the image.

Task 2

If there is a bug in the bootcamper’s task 1 that was not caught by the unit tests, it may appear in the simulator.

The console output may have: WORKER ERROR: DetectLandingPad.run() exception

As a start for debugging, ask the bootcamper to put print statements at the beginning of method and in the check failure case.

Task 3

ChatGPT outputs code that looks somewhat correct, but fails to account for the specificities of the system.

There are several solutions.

Task 4

There are several solutions.

Â