wangwei created SINGA-317:
-----------------------------
Summary: Extend ImageBatchIter to read labels in general format
Key: SINGA-317
URL: https://issues.apache.org/jira/browse/SINGA-317
Project: Singa
Issue Type: Improvement
Reporter: wangwei
Assignee: wangwei
The current ImageBatchIter assumes the meta file for the images follows the
format like
{code}
image_path, label_index
{code}
for each line.
However, one image may have multiple labels or some other meta information, e.g.
{code}
image_path1, label1 label2 label3
image_path2, label1 label3
{code}
To load general meta information, this ticket will update the ImageBatchIter:
1. assume the image_path and the other meta information (e.g. label) is
separated by a user-defined delimiter and the meta information part should not
include the delimiter.
2. split the image path and the meta information based on the delimiter
3. load the image and try to parse the meta information. For instance, if the
meta information only has the label index, then we parse the label index.
4. return a batch of images (numpy array) and i) a list of meta information
(one per image) ; or ii) a numpy array if the meta information is label index
(to be compatible with previous versions).
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)