Skip to content

Sweeper.Next() doesn't increment sw.i #2

Description

@DanTulovsky

I think you want:

// Next returns the next image and its label in the data set.
// If the end is reached, present is set to false.
func (sw *Sweeper) Next() (image RawImage, label Label, present bool) {
if sw.i >= len(sw.set.Images) {
return nil, 0, false
}
i, l, p := sw.set.Images[sw.i], sw.set.Labels[sw.i], true
sw.i++
return i, l, p
}

Otherwise it just keeps returning the first image.

Activity

huwenbo commented on Jul 16, 2020

@huwenbo

i think so also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions