Skip to content

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

@DanTulovsky

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.

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