We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aaccf5c commit a32813cCopy full SHA for a32813c
object-detection-yolov5/app/labelparse.c
@@ -123,8 +123,17 @@ void parse_labels(char*** labels_ptr,
123
}
124
125
126
+ // Filter out "n/a" entries by compacting the array.
127
+ size_t valid_label_count = 0;
128
+ for (size_t i = 0; i < num_lines; i++) {
129
+ if (strcmp(label_array[i], "n/a") != 0) {
130
+ label_array[valid_label_count] = label_array[i];
131
+ valid_label_count++;
132
+ }
133
134
+
135
*labels_ptr = label_array;
- *num_labels_ptr = num_lines;
136
+ *num_labels_ptr = valid_label_count;
137
*label_file_buffer = labels_data;
138
139
close(labels_fd);
0 commit comments