Skip to content

Commit 0e7c2fa

Browse files
fixmie[bot]abduld
fixmie[bot]
and
abduld
authored
Apply suggestions from code review
Co-Authored-By: abduld <[email protected]>
1 parent 17620db commit 0e7c2fa

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

reader/record.go

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ type ImageRecord struct {
99
Image *types.RGBImage
1010
}
1111

12+
// ImageSegmentationRecord ...
1213
type ImageSegmentationRecord struct {
1314
ID uint64
1415
LabelIndex float32

reader/tfrecord.go

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
protobuf "github.com/ubccr/terf/protobuf"
1616
)
1717

18+
// TFRecordReader ...
1819
type TFRecordReader struct {
1920
r io.ReadCloser
2021
*terf.Reader
@@ -32,6 +33,7 @@ func NewTFRecordReader(path string) (*TFRecordReader, error) {
3233
}, nil
3334
}
3435

36+
// NextRecord ...
3537
func (r *TFRecordReader) NextRecord(ctx context.Context) (*protobuf.Example, error) {
3638
nxt, err := r.Reader.Next()
3739
if err != nil {
@@ -40,6 +42,7 @@ func (r *TFRecordReader) NextRecord(ctx context.Context) (*protobuf.Example, err
4042
return nxt, nil
4143
}
4244

45+
// Next ...
4346
func (r *TFRecordReader) Next(ctx context.Context) (*ImageRecord, error) {
4447
nxt, err := r.Reader.Next()
4548
if err != nil {

reader/tfrecord/features.go

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
protobuf "github.com/ubccr/terf/protobuf"
66
)
77

8+
// FeatureBool ...
89
func FeatureBool(rec *protobuf.Example, key string) bool {
910
return FeatureInt(rec, key) == 1
1011
}
@@ -24,10 +25,12 @@ func FeatureInt64(rec *protobuf.Example, key string) int64 {
2425
return val.Int64List.Value[0]
2526
}
2627

28+
// FeatureInt ...
2729
func FeatureInt(rec *protobuf.Example, key string) int {
2830
return int(FeatureInt64(rec, key))
2931
}
3032

33+
// FeatureInt32 ...
3134
func FeatureInt32(rec *protobuf.Example, key string) int32 {
3235
return int32(FeatureInt64(rec, key))
3336
}
@@ -52,6 +55,7 @@ func FeatureFloat32(rec *protobuf.Example, key string) float32 {
5255
return val.FloatList.Value[0]
5356
}
5457

58+
// FeatureBytes ...
5559
func FeatureBytes(rec *protobuf.Example, key string) []byte {
5660
return terf.ExampleFeatureBytes(rec, key)
5761
}

vision/coco.go

+1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ func (d *CocoValidationTFRecord) Load(ctx context.Context) error {
150150
return d.loadRecord(ctx)
151151
}
152152

153+
// Next ...
153154
func (d *CocoValidationTFRecord) Next(ctx context.Context) (dldataset.LabeledData, error) {
154155
rec, err := d.recordReader.NextRecord(ctx)
155156
if err != nil {

0 commit comments

Comments
 (0)