-
Notifications
You must be signed in to change notification settings - Fork 384
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
Add SpaceNet5 #263
Add SpaceNet5 #263
Conversation
|
||
if self.speed_mask: | ||
val = speed_cls_arr[ | ||
int(feature["properties"]["inferred_speed_mph"]) - 1 |
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.
Why -1?
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.
speed_cls_arr
is an array of length 65 with a class corresponding to each index/speed mph. Essentially its a mapping between speed mph (index) and the class. -1 is to account for index starting at 0.
""" | ||
min_speed_bin = 1 | ||
max_speed_bin = 65 | ||
speed_arr_bin = np.arange(min_speed_bin, max_speed_bin + 1) |
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.
Why +1?
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.
np.arange(min, max)
produces an array ranging from min
to max-1
. +1 is to include the max
speed_arr_bin = np.arange(min_speed_bin, max_speed_bin + 1) | ||
bin_size_mph = 10.0 | ||
speed_cls_arr = np.array( | ||
[int(math.ceil(s / bin_size_mph)) for s in speed_arr_bin] |
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.
Why are we binning these? Wouldn't it be better to leave them as floats and use it in a regression problem?
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.
Binning is done to create a multi channel speed mask which would enable training a segmentation model. This was the strategy adopted by the SpaceNet authors (cresi) and the winning solutions hence why I opted for this.
Good to merge @ashnair1? |
@calebrob6 Good to go 👍 |
* Add SpaceNet5 * Add speed_mask option and test data * Fix docs * Combine fixtures * Use python copy * Remove list * Predictions -> Labels * Better error message
_load_mask
andplot
overrided to support multi channel speed masks.Sample Plots:
Binary Mask (With speed_mask=
False
)Speed Mask (With speed_mask=
True
)By default, every 10 mph constitutes a class hence 7 classes (not including background).