-
Notifications
You must be signed in to change notification settings - Fork 249
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
Pin numpy
to 1.21.2
#257
Draft
benjaminrwilson
wants to merge
5
commits into
master
Choose a base branch
from
upgrade-numpy
base: master
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.
Draft
Pin numpy
to 1.21.2
#257
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5db8263
Pin `numpy` to 1.2.1
benjaminrwilson e3cd8c1
Merge https://github.com/argoai/argoverse-api into upgrade-numpy
benjaminrwilson 0231503
Merge branch 'master' into upgrade-numpy
benjaminrwilson fc8c878
added type annotations for np.ndarrays
ahuller3 31a8641
Pin numpy to 1.21.2.
benjaminrwilson 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 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 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 |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
from typing import Dict, Iterator, List, Optional, Union, cast | ||
|
||
import numpy as np | ||
from numpy.typing import NDArray | ||
|
||
import argoverse.data_loading.object_label_record as object_label | ||
from argoverse.data_loading.object_label_record import ObjectLabelRecord | ||
|
@@ -25,7 +26,7 @@ def __init__(self, root_dir: str) -> None: | |
self.CAMERA_LIST = CAMERA_LIST | ||
self._log_list: Optional[List[str]] = None | ||
self._image_list: Optional[Dict[str, Dict[str, List[str]]]] = None | ||
self._image_list_sync: Optional[Dict[str, Dict[str, List[np.ndarray]]]] = None | ||
self._image_list_sync: Optional[Dict[str, Dict[str, List[NDArray[np.float64]]]]] = None | ||
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. Hi Anna, the image timestamps should be in nanoseconds (integers), so likely we need to cast to np.int32 or np.int64 somewhere beforehand |
||
self._lidar_list: Optional[Dict[str, List[str]]] = None | ||
self._image_timestamp_list: Optional[Dict[str, Dict[str, List[int]]]] = None | ||
self._timestamp_image_dict: Optional[Dict[str, Dict[str, Dict[int, str]]]] = None | ||
|
@@ -128,7 +129,7 @@ def image_list(self) -> Dict[str, List[str]]: | |
return self._image_list[self.current_log] | ||
|
||
@property | ||
def image_list_sync(self) -> Dict[str, List[np.ndarray]]: | ||
def image_list_sync(self) -> Dict[str, List[NDArray[np.float64]]]: | ||
"""return list of image path (str) for all cameras for the current log. | ||
|
||
The different between image_list and image_list_sync is that image_list_sync | ||
|
@@ -429,7 +430,7 @@ def get_image_at_timestamp( | |
camera: str, | ||
log_id: Optional[str] = None, | ||
load: bool = True, | ||
) -> Optional[Union[str, np.ndarray]]: | ||
) -> Optional[Union[str, NDArray[np.float64]]]: | ||
"""get image or image path at a specific timestamp | ||
|
||
Args: | ||
|
@@ -459,7 +460,7 @@ def get_image_at_timestamp( | |
|
||
def get_image( | ||
self, idx: int, camera: str, log_id: Optional[str] = None, load: bool = True | ||
) -> Union[str, np.ndarray]: | ||
) -> Union[str, NDArray[np.float64]]: | ||
"""get image or image path at a specific index (in image index) | ||
|
||
Args: | ||
|
@@ -488,7 +489,7 @@ def get_image( | |
|
||
def get_image_sync( | ||
self, idx: int, camera: str, log_id: Optional[str] = None, load: bool = True | ||
) -> Union[str, np.ndarray]: | ||
) -> Union[str, NDArray[np.float64]]: | ||
"""get image or image path at a specific index (in lidar index) | ||
|
||
Args: | ||
|
@@ -515,7 +516,7 @@ def get_image_sync( | |
return load_image(image_path) | ||
return image_path | ||
|
||
def get_lidar(self, idx: int, log_id: Optional[str] = None, load: bool = True) -> Union[str, np.ndarray]: | ||
def get_lidar(self, idx: int, log_id: Optional[str] = None, load: bool = True) -> Union[str, NDArray[np.float64]]: | ||
"""Get lidar corresponding to frame index idx (in lidar frame). | ||
|
||
Args: | ||
|
This file contains 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 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 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 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 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 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 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
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.
maybe we can cast the return arg to np.array() since, np.column_stack() should hopefully only return an array