-
Notifications
You must be signed in to change notification settings - Fork 208
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
fix multi-process reading of detection datasource and accelerate data preprocessing #23
Conversation
Args: | ||
source_item: item of source iterator | ||
classes: classes list | ||
parse_fn: parse pn to parse source_item, only accepts two params: source_item and classes |
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.
parse pn?
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.
modify to parse function
, done!
|
||
@abstractmethod | ||
def get_source_iterator(): | ||
"""data list iterator, for multi-process read |
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.
more detailed docstr is missing, iterator of which kind format of data
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.
done!
Args: | ||
source_item: item of source iterator | ||
classes: classes list | ||
parse_fn: parse function to parse source_item, only accepts two params: source_item and classes |
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.
describe what kind of data should be returned, key_name, value_type
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.
done!
logging.warning( | ||
'Something wrong with current sample %s,Try load next sample...' | ||
% result_dict.get('filename', '')) | ||
result_dict = self.get_sample(idx + 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.
this recursive call may result in index out of bounds when dealing last exmaple with exception, it will try to get the len(data_source)th element
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.
done! and add _max_retry_num to avoid looping all the 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.
docs str and code snippet should be refined
No description provided.