makeImageTensor(BufferedImage img) throws IOException {
25 |
26 | if (img.getType() != BufferedImage.TYPE_3BYTE_BGR) {
27 | throw new IOException(
28 | String.format(
29 | "Expected 3-byte BGR encoding in BufferedImage, found %d. This code could be made more robust",
30 | img.getType()));
31 | }
32 | byte[] data = ((DataBufferByte) img.getData().getDataBuffer()).getData();
33 | // ImageIO.read seems to produce BGR-encoded images, but the model expects RGB.
34 | bgr2rgb(data);
35 | final long BATCH_SIZE = 1;
36 | final long CHANNELS = 3;
37 | long[] shape = new long[] {BATCH_SIZE, img.getHeight(), img.getWidth(), CHANNELS};
38 | return Tensor.create(UInt8.class, shape, ByteBuffer.wrap(data));
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/object_detection/protos/StringIntLabelMapOuterClass.java:
--------------------------------------------------------------------------------
1 | package object_detection.protos;
2 |
3 | // Generated by the protocol buffer compiler. DO NOT EDIT!
4 | // source: string_int_label_map.proto
5 |
6 | public final class StringIntLabelMapOuterClass {
7 | private StringIntLabelMapOuterClass() {}
8 | public static void registerAllExtensions(
9 | com.google.protobuf.ExtensionRegistryLite registry) {
10 | }
11 |
12 | public static void registerAllExtensions(
13 | com.google.protobuf.ExtensionRegistry registry) {
14 | registerAllExtensions(
15 | (com.google.protobuf.ExtensionRegistryLite) registry);
16 | }
17 | public interface StringIntLabelMapItemOrBuilder extends
18 | // @@protoc_insertion_point(interface_extends:object_detection.protos.StringIntLabelMapItem)
19 | com.google.protobuf.MessageOrBuilder {
20 |
21 | /**
22 | *
23 | * String name. The most common practice is to set this to a MID or synsets
24 | * id.
25 | *
26 | *
27 | * optional string name = 1;
28 | */
29 | boolean hasName();
30 | /**
31 | *
32 | * String name. The most common practice is to set this to a MID or synsets
33 | * id.
34 | *
35 | *
36 | * optional string name = 1;
37 | */
38 | java.lang.String getName();
39 | /**
40 | *
41 | * String name. The most common practice is to set this to a MID or synsets
42 | * id.
43 | *
44 | *
45 | * optional string name = 1;
46 | */
47 | com.google.protobuf.ByteString
48 | getNameBytes();
49 |
50 | /**
51 | *
52 | * Integer id that maps to the string name above. Label ids should start from
53 | * 1.
54 | *
55 | *
56 | * optional int32 id = 2;
57 | */
58 | boolean hasId();
59 | /**
60 | *
61 | * Integer id that maps to the string name above. Label ids should start from
62 | * 1.
63 | *
64 | *
65 | * optional int32 id = 2;
66 | */
67 | int getId();
68 |
69 | /**
70 | *
71 | * Human readable string label.
72 | *
73 | *
74 | * optional string display_name = 3;
75 | */
76 | boolean hasDisplayName();
77 | /**
78 | *
79 | * Human readable string label.
80 | *
81 | *
82 | * optional string display_name = 3;
83 | */
84 | java.lang.String getDisplayName();
85 | /**
86 | *
87 | * Human readable string label.
88 | *
89 | *
90 | * optional string display_name = 3;
91 | */
92 | com.google.protobuf.ByteString
93 | getDisplayNameBytes();
94 | }
95 | /**
96 | * Protobuf type {@code object_detection.protos.StringIntLabelMapItem}
97 | */
98 | public static final class StringIntLabelMapItem extends
99 | com.google.protobuf.GeneratedMessageV3 implements
100 | // @@protoc_insertion_point(message_implements:object_detection.protos.StringIntLabelMapItem)
101 | StringIntLabelMapItemOrBuilder {
102 | private static final long serialVersionUID = 0L;
103 | // Use StringIntLabelMapItem.newBuilder() to construct.
104 | private StringIntLabelMapItem(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
105 | super(builder);
106 | }
107 | private StringIntLabelMapItem() {
108 | name_ = "";
109 | id_ = 0;
110 | displayName_ = "";
111 | }
112 |
113 | @java.lang.Override
114 | public final com.google.protobuf.UnknownFieldSet
115 | getUnknownFields() {
116 | return this.unknownFields;
117 | }
118 | private StringIntLabelMapItem(
119 | com.google.protobuf.CodedInputStream input,
120 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
121 | throws com.google.protobuf.InvalidProtocolBufferException {
122 | this();
123 | if (extensionRegistry == null) {
124 | throw new java.lang.NullPointerException();
125 | }
126 | int mutable_bitField0_ = 0;
127 | com.google.protobuf.UnknownFieldSet.Builder unknownFields =
128 | com.google.protobuf.UnknownFieldSet.newBuilder();
129 | try {
130 | boolean done = false;
131 | while (!done) {
132 | int tag = input.readTag();
133 | switch (tag) {
134 | case 0:
135 | done = true;
136 | break;
137 | default: {
138 | if (!parseUnknownField(
139 | input, unknownFields, extensionRegistry, tag)) {
140 | done = true;
141 | }
142 | break;
143 | }
144 | case 10: {
145 | com.google.protobuf.ByteString bs = input.readBytes();
146 | bitField0_ |= 0x00000001;
147 | name_ = bs;
148 | break;
149 | }
150 | case 16: {
151 | bitField0_ |= 0x00000002;
152 | id_ = input.readInt32();
153 | break;
154 | }
155 | case 26: {
156 | com.google.protobuf.ByteString bs = input.readBytes();
157 | bitField0_ |= 0x00000004;
158 | displayName_ = bs;
159 | break;
160 | }
161 | }
162 | }
163 | } catch (com.google.protobuf.InvalidProtocolBufferException e) {
164 | throw e.setUnfinishedMessage(this);
165 | } catch (java.io.IOException e) {
166 | throw new com.google.protobuf.InvalidProtocolBufferException(
167 | e).setUnfinishedMessage(this);
168 | } finally {
169 | this.unknownFields = unknownFields.build();
170 | makeExtensionsImmutable();
171 | }
172 | }
173 | public static final com.google.protobuf.Descriptors.Descriptor
174 | getDescriptor() {
175 | return object_detection.protos.StringIntLabelMapOuterClass.internal_static_object_detection_protos_StringIntLabelMapItem_descriptor;
176 | }
177 |
178 | protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
179 | internalGetFieldAccessorTable() {
180 | return object_detection.protos.StringIntLabelMapOuterClass.internal_static_object_detection_protos_StringIntLabelMapItem_fieldAccessorTable
181 | .ensureFieldAccessorsInitialized(
182 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem.class, object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem.Builder.class);
183 | }
184 |
185 | private int bitField0_;
186 | public static final int NAME_FIELD_NUMBER = 1;
187 | private volatile java.lang.Object name_;
188 | /**
189 | *
190 | * String name. The most common practice is to set this to a MID or synsets
191 | * id.
192 | *
193 | *
194 | * optional string name = 1;
195 | */
196 | public boolean hasName() {
197 | return ((bitField0_ & 0x00000001) == 0x00000001);
198 | }
199 | /**
200 | *
201 | * String name. The most common practice is to set this to a MID or synsets
202 | * id.
203 | *
204 | *
205 | * optional string name = 1;
206 | */
207 | public java.lang.String getName() {
208 | java.lang.Object ref = name_;
209 | if (ref instanceof java.lang.String) {
210 | return (java.lang.String) ref;
211 | } else {
212 | com.google.protobuf.ByteString bs =
213 | (com.google.protobuf.ByteString) ref;
214 | java.lang.String s = bs.toStringUtf8();
215 | if (bs.isValidUtf8()) {
216 | name_ = s;
217 | }
218 | return s;
219 | }
220 | }
221 | /**
222 | *
223 | * String name. The most common practice is to set this to a MID or synsets
224 | * id.
225 | *
226 | *
227 | * optional string name = 1;
228 | */
229 | public com.google.protobuf.ByteString
230 | getNameBytes() {
231 | java.lang.Object ref = name_;
232 | if (ref instanceof java.lang.String) {
233 | com.google.protobuf.ByteString b =
234 | com.google.protobuf.ByteString.copyFromUtf8(
235 | (java.lang.String) ref);
236 | name_ = b;
237 | return b;
238 | } else {
239 | return (com.google.protobuf.ByteString) ref;
240 | }
241 | }
242 |
243 | public static final int ID_FIELD_NUMBER = 2;
244 | private int id_;
245 | /**
246 | *
247 | * Integer id that maps to the string name above. Label ids should start from
248 | * 1.
249 | *
250 | *
251 | * optional int32 id = 2;
252 | */
253 | public boolean hasId() {
254 | return ((bitField0_ & 0x00000002) == 0x00000002);
255 | }
256 | /**
257 | *
258 | * Integer id that maps to the string name above. Label ids should start from
259 | * 1.
260 | *
261 | *
262 | * optional int32 id = 2;
263 | */
264 | public int getId() {
265 | return id_;
266 | }
267 |
268 | public static final int DISPLAY_NAME_FIELD_NUMBER = 3;
269 | private volatile java.lang.Object displayName_;
270 | /**
271 | *
272 | * Human readable string label.
273 | *
274 | *
275 | * optional string display_name = 3;
276 | */
277 | public boolean hasDisplayName() {
278 | return ((bitField0_ & 0x00000004) == 0x00000004);
279 | }
280 | /**
281 | *
282 | * Human readable string label.
283 | *
284 | *
285 | * optional string display_name = 3;
286 | */
287 | public java.lang.String getDisplayName() {
288 | java.lang.Object ref = displayName_;
289 | if (ref instanceof java.lang.String) {
290 | return (java.lang.String) ref;
291 | } else {
292 | com.google.protobuf.ByteString bs =
293 | (com.google.protobuf.ByteString) ref;
294 | java.lang.String s = bs.toStringUtf8();
295 | if (bs.isValidUtf8()) {
296 | displayName_ = s;
297 | }
298 | return s;
299 | }
300 | }
301 | /**
302 | *
303 | * Human readable string label.
304 | *
305 | *
306 | * optional string display_name = 3;
307 | */
308 | public com.google.protobuf.ByteString
309 | getDisplayNameBytes() {
310 | java.lang.Object ref = displayName_;
311 | if (ref instanceof java.lang.String) {
312 | com.google.protobuf.ByteString b =
313 | com.google.protobuf.ByteString.copyFromUtf8(
314 | (java.lang.String) ref);
315 | displayName_ = b;
316 | return b;
317 | } else {
318 | return (com.google.protobuf.ByteString) ref;
319 | }
320 | }
321 |
322 | private byte memoizedIsInitialized = -1;
323 | public final boolean isInitialized() {
324 | byte isInitialized = memoizedIsInitialized;
325 | if (isInitialized == 1) return true;
326 | if (isInitialized == 0) return false;
327 |
328 | memoizedIsInitialized = 1;
329 | return true;
330 | }
331 |
332 | public void writeTo(com.google.protobuf.CodedOutputStream output)
333 | throws java.io.IOException {
334 | if (((bitField0_ & 0x00000001) == 0x00000001)) {
335 | com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
336 | }
337 | if (((bitField0_ & 0x00000002) == 0x00000002)) {
338 | output.writeInt32(2, id_);
339 | }
340 | if (((bitField0_ & 0x00000004) == 0x00000004)) {
341 | com.google.protobuf.GeneratedMessageV3.writeString(output, 3, displayName_);
342 | }
343 | unknownFields.writeTo(output);
344 | }
345 |
346 | public int getSerializedSize() {
347 | int size = memoizedSize;
348 | if (size != -1) return size;
349 |
350 | size = 0;
351 | if (((bitField0_ & 0x00000001) == 0x00000001)) {
352 | size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
353 | }
354 | if (((bitField0_ & 0x00000002) == 0x00000002)) {
355 | size += com.google.protobuf.CodedOutputStream
356 | .computeInt32Size(2, id_);
357 | }
358 | if (((bitField0_ & 0x00000004) == 0x00000004)) {
359 | size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, displayName_);
360 | }
361 | size += unknownFields.getSerializedSize();
362 | memoizedSize = size;
363 | return size;
364 | }
365 |
366 | @java.lang.Override
367 | public boolean equals(final java.lang.Object obj) {
368 | if (obj == this) {
369 | return true;
370 | }
371 | if (!(obj instanceof object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem)) {
372 | return super.equals(obj);
373 | }
374 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem other = (object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem) obj;
375 |
376 | boolean result = true;
377 | result = result && (hasName() == other.hasName());
378 | if (hasName()) {
379 | result = result && getName()
380 | .equals(other.getName());
381 | }
382 | result = result && (hasId() == other.hasId());
383 | if (hasId()) {
384 | result = result && (getId()
385 | == other.getId());
386 | }
387 | result = result && (hasDisplayName() == other.hasDisplayName());
388 | if (hasDisplayName()) {
389 | result = result && getDisplayName()
390 | .equals(other.getDisplayName());
391 | }
392 | result = result && unknownFields.equals(other.unknownFields);
393 | return result;
394 | }
395 |
396 | @java.lang.Override
397 | public int hashCode() {
398 | if (memoizedHashCode != 0) {
399 | return memoizedHashCode;
400 | }
401 | int hash = 41;
402 | hash = (19 * hash) + getDescriptor().hashCode();
403 | if (hasName()) {
404 | hash = (37 * hash) + NAME_FIELD_NUMBER;
405 | hash = (53 * hash) + getName().hashCode();
406 | }
407 | if (hasId()) {
408 | hash = (37 * hash) + ID_FIELD_NUMBER;
409 | hash = (53 * hash) + getId();
410 | }
411 | if (hasDisplayName()) {
412 | hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER;
413 | hash = (53 * hash) + getDisplayName().hashCode();
414 | }
415 | hash = (29 * hash) + unknownFields.hashCode();
416 | memoizedHashCode = hash;
417 | return hash;
418 | }
419 |
420 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem parseFrom(
421 | java.nio.ByteBuffer data)
422 | throws com.google.protobuf.InvalidProtocolBufferException {
423 | return PARSER.parseFrom(data);
424 | }
425 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem parseFrom(
426 | java.nio.ByteBuffer data,
427 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
428 | throws com.google.protobuf.InvalidProtocolBufferException {
429 | return PARSER.parseFrom(data, extensionRegistry);
430 | }
431 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem parseFrom(
432 | com.google.protobuf.ByteString data)
433 | throws com.google.protobuf.InvalidProtocolBufferException {
434 | return PARSER.parseFrom(data);
435 | }
436 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem parseFrom(
437 | com.google.protobuf.ByteString data,
438 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
439 | throws com.google.protobuf.InvalidProtocolBufferException {
440 | return PARSER.parseFrom(data, extensionRegistry);
441 | }
442 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem parseFrom(byte[] data)
443 | throws com.google.protobuf.InvalidProtocolBufferException {
444 | return PARSER.parseFrom(data);
445 | }
446 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem parseFrom(
447 | byte[] data,
448 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
449 | throws com.google.protobuf.InvalidProtocolBufferException {
450 | return PARSER.parseFrom(data, extensionRegistry);
451 | }
452 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem parseFrom(java.io.InputStream input)
453 | throws java.io.IOException {
454 | return com.google.protobuf.GeneratedMessageV3
455 | .parseWithIOException(PARSER, input);
456 | }
457 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem parseFrom(
458 | java.io.InputStream input,
459 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
460 | throws java.io.IOException {
461 | return com.google.protobuf.GeneratedMessageV3
462 | .parseWithIOException(PARSER, input, extensionRegistry);
463 | }
464 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem parseDelimitedFrom(java.io.InputStream input)
465 | throws java.io.IOException {
466 | return com.google.protobuf.GeneratedMessageV3
467 | .parseDelimitedWithIOException(PARSER, input);
468 | }
469 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem parseDelimitedFrom(
470 | java.io.InputStream input,
471 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
472 | throws java.io.IOException {
473 | return com.google.protobuf.GeneratedMessageV3
474 | .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
475 | }
476 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem parseFrom(
477 | com.google.protobuf.CodedInputStream input)
478 | throws java.io.IOException {
479 | return com.google.protobuf.GeneratedMessageV3
480 | .parseWithIOException(PARSER, input);
481 | }
482 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem parseFrom(
483 | com.google.protobuf.CodedInputStream input,
484 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
485 | throws java.io.IOException {
486 | return com.google.protobuf.GeneratedMessageV3
487 | .parseWithIOException(PARSER, input, extensionRegistry);
488 | }
489 |
490 | public Builder newBuilderForType() { return newBuilder(); }
491 | public static Builder newBuilder() {
492 | return DEFAULT_INSTANCE.toBuilder();
493 | }
494 | public static Builder newBuilder(object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem prototype) {
495 | return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
496 | }
497 | public Builder toBuilder() {
498 | return this == DEFAULT_INSTANCE
499 | ? new Builder() : new Builder().mergeFrom(this);
500 | }
501 |
502 | @java.lang.Override
503 | protected Builder newBuilderForType(
504 | com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
505 | Builder builder = new Builder(parent);
506 | return builder;
507 | }
508 | /**
509 | * Protobuf type {@code object_detection.protos.StringIntLabelMapItem}
510 | */
511 | public static final class Builder extends
512 | com.google.protobuf.GeneratedMessageV3.Builder implements
513 | // @@protoc_insertion_point(builder_implements:object_detection.protos.StringIntLabelMapItem)
514 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItemOrBuilder {
515 | public static final com.google.protobuf.Descriptors.Descriptor
516 | getDescriptor() {
517 | return object_detection.protos.StringIntLabelMapOuterClass.internal_static_object_detection_protos_StringIntLabelMapItem_descriptor;
518 | }
519 |
520 | protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
521 | internalGetFieldAccessorTable() {
522 | return object_detection.protos.StringIntLabelMapOuterClass.internal_static_object_detection_protos_StringIntLabelMapItem_fieldAccessorTable
523 | .ensureFieldAccessorsInitialized(
524 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem.class, object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem.Builder.class);
525 | }
526 |
527 | // Construct using object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem.newBuilder()
528 | private Builder() {
529 | maybeForceBuilderInitialization();
530 | }
531 |
532 | private Builder(
533 | com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
534 | super(parent);
535 | maybeForceBuilderInitialization();
536 | }
537 | private void maybeForceBuilderInitialization() {
538 | if (com.google.protobuf.GeneratedMessageV3
539 | .alwaysUseFieldBuilders) {
540 | }
541 | }
542 | public Builder clear() {
543 | super.clear();
544 | name_ = "";
545 | bitField0_ = (bitField0_ & ~0x00000001);
546 | id_ = 0;
547 | bitField0_ = (bitField0_ & ~0x00000002);
548 | displayName_ = "";
549 | bitField0_ = (bitField0_ & ~0x00000004);
550 | return this;
551 | }
552 |
553 | public com.google.protobuf.Descriptors.Descriptor
554 | getDescriptorForType() {
555 | return object_detection.protos.StringIntLabelMapOuterClass.internal_static_object_detection_protos_StringIntLabelMapItem_descriptor;
556 | }
557 |
558 | public object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem getDefaultInstanceForType() {
559 | return object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem.getDefaultInstance();
560 | }
561 |
562 | public object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem build() {
563 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem result = buildPartial();
564 | if (!result.isInitialized()) {
565 | throw newUninitializedMessageException(result);
566 | }
567 | return result;
568 | }
569 |
570 | public object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem buildPartial() {
571 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem result = new object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem(this);
572 | int from_bitField0_ = bitField0_;
573 | int to_bitField0_ = 0;
574 | if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
575 | to_bitField0_ |= 0x00000001;
576 | }
577 | result.name_ = name_;
578 | if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
579 | to_bitField0_ |= 0x00000002;
580 | }
581 | result.id_ = id_;
582 | if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
583 | to_bitField0_ |= 0x00000004;
584 | }
585 | result.displayName_ = displayName_;
586 | result.bitField0_ = to_bitField0_;
587 | onBuilt();
588 | return result;
589 | }
590 |
591 | public Builder clone() {
592 | return (Builder) super.clone();
593 | }
594 | public Builder setField(
595 | com.google.protobuf.Descriptors.FieldDescriptor field,
596 | java.lang.Object value) {
597 | return (Builder) super.setField(field, value);
598 | }
599 | public Builder clearField(
600 | com.google.protobuf.Descriptors.FieldDescriptor field) {
601 | return (Builder) super.clearField(field);
602 | }
603 | public Builder clearOneof(
604 | com.google.protobuf.Descriptors.OneofDescriptor oneof) {
605 | return (Builder) super.clearOneof(oneof);
606 | }
607 | public Builder setRepeatedField(
608 | com.google.protobuf.Descriptors.FieldDescriptor field,
609 | int index, java.lang.Object value) {
610 | return (Builder) super.setRepeatedField(field, index, value);
611 | }
612 | public Builder addRepeatedField(
613 | com.google.protobuf.Descriptors.FieldDescriptor field,
614 | java.lang.Object value) {
615 | return (Builder) super.addRepeatedField(field, value);
616 | }
617 | public Builder mergeFrom(com.google.protobuf.Message other) {
618 | if (other instanceof object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem) {
619 | return mergeFrom((object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem)other);
620 | } else {
621 | super.mergeFrom(other);
622 | return this;
623 | }
624 | }
625 |
626 | public Builder mergeFrom(object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem other) {
627 | if (other == object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem.getDefaultInstance()) return this;
628 | if (other.hasName()) {
629 | bitField0_ |= 0x00000001;
630 | name_ = other.name_;
631 | onChanged();
632 | }
633 | if (other.hasId()) {
634 | setId(other.getId());
635 | }
636 | if (other.hasDisplayName()) {
637 | bitField0_ |= 0x00000004;
638 | displayName_ = other.displayName_;
639 | onChanged();
640 | }
641 | this.mergeUnknownFields(other.unknownFields);
642 | onChanged();
643 | return this;
644 | }
645 |
646 | public final boolean isInitialized() {
647 | return true;
648 | }
649 |
650 | public Builder mergeFrom(
651 | com.google.protobuf.CodedInputStream input,
652 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
653 | throws java.io.IOException {
654 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem parsedMessage = null;
655 | try {
656 | parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
657 | } catch (com.google.protobuf.InvalidProtocolBufferException e) {
658 | parsedMessage = (object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem) e.getUnfinishedMessage();
659 | throw e.unwrapIOException();
660 | } finally {
661 | if (parsedMessage != null) {
662 | mergeFrom(parsedMessage);
663 | }
664 | }
665 | return this;
666 | }
667 | private int bitField0_;
668 |
669 | private java.lang.Object name_ = "";
670 | /**
671 | *
672 | * String name. The most common practice is to set this to a MID or synsets
673 | * id.
674 | *
675 | *
676 | * optional string name = 1;
677 | */
678 | public boolean hasName() {
679 | return ((bitField0_ & 0x00000001) == 0x00000001);
680 | }
681 | /**
682 | *
683 | * String name. The most common practice is to set this to a MID or synsets
684 | * id.
685 | *
686 | *
687 | * optional string name = 1;
688 | */
689 | public java.lang.String getName() {
690 | java.lang.Object ref = name_;
691 | if (!(ref instanceof java.lang.String)) {
692 | com.google.protobuf.ByteString bs =
693 | (com.google.protobuf.ByteString) ref;
694 | java.lang.String s = bs.toStringUtf8();
695 | if (bs.isValidUtf8()) {
696 | name_ = s;
697 | }
698 | return s;
699 | } else {
700 | return (java.lang.String) ref;
701 | }
702 | }
703 | /**
704 | *
705 | * String name. The most common practice is to set this to a MID or synsets
706 | * id.
707 | *
708 | *
709 | * optional string name = 1;
710 | */
711 | public com.google.protobuf.ByteString
712 | getNameBytes() {
713 | java.lang.Object ref = name_;
714 | if (ref instanceof String) {
715 | com.google.protobuf.ByteString b =
716 | com.google.protobuf.ByteString.copyFromUtf8(
717 | (java.lang.String) ref);
718 | name_ = b;
719 | return b;
720 | } else {
721 | return (com.google.protobuf.ByteString) ref;
722 | }
723 | }
724 | /**
725 | *
726 | * String name. The most common practice is to set this to a MID or synsets
727 | * id.
728 | *
729 | *
730 | * optional string name = 1;
731 | */
732 | public Builder setName(
733 | java.lang.String value) {
734 | if (value == null) {
735 | throw new NullPointerException();
736 | }
737 | bitField0_ |= 0x00000001;
738 | name_ = value;
739 | onChanged();
740 | return this;
741 | }
742 | /**
743 | *
744 | * String name. The most common practice is to set this to a MID or synsets
745 | * id.
746 | *
747 | *
748 | * optional string name = 1;
749 | */
750 | public Builder clearName() {
751 | bitField0_ = (bitField0_ & ~0x00000001);
752 | name_ = getDefaultInstance().getName();
753 | onChanged();
754 | return this;
755 | }
756 | /**
757 | *
758 | * String name. The most common practice is to set this to a MID or synsets
759 | * id.
760 | *
761 | *
762 | * optional string name = 1;
763 | */
764 | public Builder setNameBytes(
765 | com.google.protobuf.ByteString value) {
766 | if (value == null) {
767 | throw new NullPointerException();
768 | }
769 | bitField0_ |= 0x00000001;
770 | name_ = value;
771 | onChanged();
772 | return this;
773 | }
774 |
775 | private int id_ ;
776 | /**
777 | *
778 | * Integer id that maps to the string name above. Label ids should start from
779 | * 1.
780 | *
781 | *
782 | * optional int32 id = 2;
783 | */
784 | public boolean hasId() {
785 | return ((bitField0_ & 0x00000002) == 0x00000002);
786 | }
787 | /**
788 | *
789 | * Integer id that maps to the string name above. Label ids should start from
790 | * 1.
791 | *
792 | *
793 | * optional int32 id = 2;
794 | */
795 | public int getId() {
796 | return id_;
797 | }
798 | /**
799 | *
800 | * Integer id that maps to the string name above. Label ids should start from
801 | * 1.
802 | *
803 | *
804 | * optional int32 id = 2;
805 | */
806 | public Builder setId(int value) {
807 | bitField0_ |= 0x00000002;
808 | id_ = value;
809 | onChanged();
810 | return this;
811 | }
812 | /**
813 | *
814 | * Integer id that maps to the string name above. Label ids should start from
815 | * 1.
816 | *
817 | *
818 | * optional int32 id = 2;
819 | */
820 | public Builder clearId() {
821 | bitField0_ = (bitField0_ & ~0x00000002);
822 | id_ = 0;
823 | onChanged();
824 | return this;
825 | }
826 |
827 | private java.lang.Object displayName_ = "";
828 | /**
829 | *
830 | * Human readable string label.
831 | *
832 | *
833 | * optional string display_name = 3;
834 | */
835 | public boolean hasDisplayName() {
836 | return ((bitField0_ & 0x00000004) == 0x00000004);
837 | }
838 | /**
839 | *
840 | * Human readable string label.
841 | *
842 | *
843 | * optional string display_name = 3;
844 | */
845 | public java.lang.String getDisplayName() {
846 | java.lang.Object ref = displayName_;
847 | if (!(ref instanceof java.lang.String)) {
848 | com.google.protobuf.ByteString bs =
849 | (com.google.protobuf.ByteString) ref;
850 | java.lang.String s = bs.toStringUtf8();
851 | if (bs.isValidUtf8()) {
852 | displayName_ = s;
853 | }
854 | return s;
855 | } else {
856 | return (java.lang.String) ref;
857 | }
858 | }
859 | /**
860 | *
861 | * Human readable string label.
862 | *
863 | *
864 | * optional string display_name = 3;
865 | */
866 | public com.google.protobuf.ByteString
867 | getDisplayNameBytes() {
868 | java.lang.Object ref = displayName_;
869 | if (ref instanceof String) {
870 | com.google.protobuf.ByteString b =
871 | com.google.protobuf.ByteString.copyFromUtf8(
872 | (java.lang.String) ref);
873 | displayName_ = b;
874 | return b;
875 | } else {
876 | return (com.google.protobuf.ByteString) ref;
877 | }
878 | }
879 | /**
880 | *
881 | * Human readable string label.
882 | *
883 | *
884 | * optional string display_name = 3;
885 | */
886 | public Builder setDisplayName(
887 | java.lang.String value) {
888 | if (value == null) {
889 | throw new NullPointerException();
890 | }
891 | bitField0_ |= 0x00000004;
892 | displayName_ = value;
893 | onChanged();
894 | return this;
895 | }
896 | /**
897 | *
898 | * Human readable string label.
899 | *
900 | *
901 | * optional string display_name = 3;
902 | */
903 | public Builder clearDisplayName() {
904 | bitField0_ = (bitField0_ & ~0x00000004);
905 | displayName_ = getDefaultInstance().getDisplayName();
906 | onChanged();
907 | return this;
908 | }
909 | /**
910 | *
911 | * Human readable string label.
912 | *
913 | *
914 | * optional string display_name = 3;
915 | */
916 | public Builder setDisplayNameBytes(
917 | com.google.protobuf.ByteString value) {
918 | if (value == null) {
919 | throw new NullPointerException();
920 | }
921 | bitField0_ |= 0x00000004;
922 | displayName_ = value;
923 | onChanged();
924 | return this;
925 | }
926 | public final Builder setUnknownFields(
927 | final com.google.protobuf.UnknownFieldSet unknownFields) {
928 | return super.setUnknownFields(unknownFields);
929 | }
930 |
931 | public final Builder mergeUnknownFields(
932 | final com.google.protobuf.UnknownFieldSet unknownFields) {
933 | return super.mergeUnknownFields(unknownFields);
934 | }
935 |
936 |
937 | // @@protoc_insertion_point(builder_scope:object_detection.protos.StringIntLabelMapItem)
938 | }
939 |
940 | // @@protoc_insertion_point(class_scope:object_detection.protos.StringIntLabelMapItem)
941 | private static final object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem DEFAULT_INSTANCE;
942 | static {
943 | DEFAULT_INSTANCE = new object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem();
944 | }
945 |
946 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem getDefaultInstance() {
947 | return DEFAULT_INSTANCE;
948 | }
949 |
950 | @java.lang.Deprecated public static final com.google.protobuf.Parser
951 | PARSER = new com.google.protobuf.AbstractParser() {
952 | public StringIntLabelMapItem parsePartialFrom(
953 | com.google.protobuf.CodedInputStream input,
954 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
955 | throws com.google.protobuf.InvalidProtocolBufferException {
956 | return new StringIntLabelMapItem(input, extensionRegistry);
957 | }
958 | };
959 |
960 | public static com.google.protobuf.Parser parser() {
961 | return PARSER;
962 | }
963 |
964 | @java.lang.Override
965 | public com.google.protobuf.Parser getParserForType() {
966 | return PARSER;
967 | }
968 |
969 | public object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem getDefaultInstanceForType() {
970 | return DEFAULT_INSTANCE;
971 | }
972 |
973 | }
974 |
975 | public interface StringIntLabelMapOrBuilder extends
976 | // @@protoc_insertion_point(interface_extends:object_detection.protos.StringIntLabelMap)
977 | com.google.protobuf.MessageOrBuilder {
978 |
979 | /**
980 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
981 | */
982 | java.util.List
983 | getItemList();
984 | /**
985 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
986 | */
987 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem getItem(int index);
988 | /**
989 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
990 | */
991 | int getItemCount();
992 | /**
993 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
994 | */
995 | java.util.List extends object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItemOrBuilder>
996 | getItemOrBuilderList();
997 | /**
998 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
999 | */
1000 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItemOrBuilder getItemOrBuilder(
1001 | int index);
1002 | }
1003 | /**
1004 | * Protobuf type {@code object_detection.protos.StringIntLabelMap}
1005 | */
1006 | public static final class StringIntLabelMap extends
1007 | com.google.protobuf.GeneratedMessageV3 implements
1008 | // @@protoc_insertion_point(message_implements:object_detection.protos.StringIntLabelMap)
1009 | StringIntLabelMapOrBuilder {
1010 | private static final long serialVersionUID = 0L;
1011 | // Use StringIntLabelMap.newBuilder() to construct.
1012 | private StringIntLabelMap(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
1013 | super(builder);
1014 | }
1015 | private StringIntLabelMap() {
1016 | item_ = java.util.Collections.emptyList();
1017 | }
1018 |
1019 | @java.lang.Override
1020 | public final com.google.protobuf.UnknownFieldSet
1021 | getUnknownFields() {
1022 | return this.unknownFields;
1023 | }
1024 | private StringIntLabelMap(
1025 | com.google.protobuf.CodedInputStream input,
1026 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1027 | throws com.google.protobuf.InvalidProtocolBufferException {
1028 | this();
1029 | if (extensionRegistry == null) {
1030 | throw new java.lang.NullPointerException();
1031 | }
1032 | int mutable_bitField0_ = 0;
1033 | com.google.protobuf.UnknownFieldSet.Builder unknownFields =
1034 | com.google.protobuf.UnknownFieldSet.newBuilder();
1035 | try {
1036 | boolean done = false;
1037 | while (!done) {
1038 | int tag = input.readTag();
1039 | switch (tag) {
1040 | case 0:
1041 | done = true;
1042 | break;
1043 | default: {
1044 | if (!parseUnknownField(
1045 | input, unknownFields, extensionRegistry, tag)) {
1046 | done = true;
1047 | }
1048 | break;
1049 | }
1050 | case 10: {
1051 | if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
1052 | item_ = new java.util.ArrayList();
1053 | mutable_bitField0_ |= 0x00000001;
1054 | }
1055 | item_.add(
1056 | input.readMessage(object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem.PARSER, extensionRegistry));
1057 | break;
1058 | }
1059 | }
1060 | }
1061 | } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1062 | throw e.setUnfinishedMessage(this);
1063 | } catch (java.io.IOException e) {
1064 | throw new com.google.protobuf.InvalidProtocolBufferException(
1065 | e).setUnfinishedMessage(this);
1066 | } finally {
1067 | if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
1068 | item_ = java.util.Collections.unmodifiableList(item_);
1069 | }
1070 | this.unknownFields = unknownFields.build();
1071 | makeExtensionsImmutable();
1072 | }
1073 | }
1074 | public static final com.google.protobuf.Descriptors.Descriptor
1075 | getDescriptor() {
1076 | return object_detection.protos.StringIntLabelMapOuterClass.internal_static_object_detection_protos_StringIntLabelMap_descriptor;
1077 | }
1078 |
1079 | protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
1080 | internalGetFieldAccessorTable() {
1081 | return object_detection.protos.StringIntLabelMapOuterClass.internal_static_object_detection_protos_StringIntLabelMap_fieldAccessorTable
1082 | .ensureFieldAccessorsInitialized(
1083 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap.class, object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap.Builder.class);
1084 | }
1085 |
1086 | public static final int ITEM_FIELD_NUMBER = 1;
1087 | private java.util.List item_;
1088 | /**
1089 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1090 | */
1091 | public java.util.List getItemList() {
1092 | return item_;
1093 | }
1094 | /**
1095 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1096 | */
1097 | public java.util.List extends object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItemOrBuilder>
1098 | getItemOrBuilderList() {
1099 | return item_;
1100 | }
1101 | /**
1102 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1103 | */
1104 | public int getItemCount() {
1105 | return item_.size();
1106 | }
1107 | /**
1108 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1109 | */
1110 | public object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem getItem(int index) {
1111 | return item_.get(index);
1112 | }
1113 | /**
1114 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1115 | */
1116 | public object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItemOrBuilder getItemOrBuilder(
1117 | int index) {
1118 | return item_.get(index);
1119 | }
1120 |
1121 | private byte memoizedIsInitialized = -1;
1122 | public final boolean isInitialized() {
1123 | byte isInitialized = memoizedIsInitialized;
1124 | if (isInitialized == 1) return true;
1125 | if (isInitialized == 0) return false;
1126 |
1127 | memoizedIsInitialized = 1;
1128 | return true;
1129 | }
1130 |
1131 | public void writeTo(com.google.protobuf.CodedOutputStream output)
1132 | throws java.io.IOException {
1133 | for (int i = 0; i < item_.size(); i++) {
1134 | output.writeMessage(1, item_.get(i));
1135 | }
1136 | unknownFields.writeTo(output);
1137 | }
1138 |
1139 | public int getSerializedSize() {
1140 | int size = memoizedSize;
1141 | if (size != -1) return size;
1142 |
1143 | size = 0;
1144 | for (int i = 0; i < item_.size(); i++) {
1145 | size += com.google.protobuf.CodedOutputStream
1146 | .computeMessageSize(1, item_.get(i));
1147 | }
1148 | size += unknownFields.getSerializedSize();
1149 | memoizedSize = size;
1150 | return size;
1151 | }
1152 |
1153 | @java.lang.Override
1154 | public boolean equals(final java.lang.Object obj) {
1155 | if (obj == this) {
1156 | return true;
1157 | }
1158 | if (!(obj instanceof object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap)) {
1159 | return super.equals(obj);
1160 | }
1161 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap other = (object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap) obj;
1162 |
1163 | boolean result = true;
1164 | result = result && getItemList()
1165 | .equals(other.getItemList());
1166 | result = result && unknownFields.equals(other.unknownFields);
1167 | return result;
1168 | }
1169 |
1170 | @java.lang.Override
1171 | public int hashCode() {
1172 | if (memoizedHashCode != 0) {
1173 | return memoizedHashCode;
1174 | }
1175 | int hash = 41;
1176 | hash = (19 * hash) + getDescriptor().hashCode();
1177 | if (getItemCount() > 0) {
1178 | hash = (37 * hash) + ITEM_FIELD_NUMBER;
1179 | hash = (53 * hash) + getItemList().hashCode();
1180 | }
1181 | hash = (29 * hash) + unknownFields.hashCode();
1182 | memoizedHashCode = hash;
1183 | return hash;
1184 | }
1185 |
1186 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap parseFrom(
1187 | java.nio.ByteBuffer data)
1188 | throws com.google.protobuf.InvalidProtocolBufferException {
1189 | return PARSER.parseFrom(data);
1190 | }
1191 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap parseFrom(
1192 | java.nio.ByteBuffer data,
1193 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1194 | throws com.google.protobuf.InvalidProtocolBufferException {
1195 | return PARSER.parseFrom(data, extensionRegistry);
1196 | }
1197 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap parseFrom(
1198 | com.google.protobuf.ByteString data)
1199 | throws com.google.protobuf.InvalidProtocolBufferException {
1200 | return PARSER.parseFrom(data);
1201 | }
1202 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap parseFrom(
1203 | com.google.protobuf.ByteString data,
1204 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1205 | throws com.google.protobuf.InvalidProtocolBufferException {
1206 | return PARSER.parseFrom(data, extensionRegistry);
1207 | }
1208 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap parseFrom(byte[] data)
1209 | throws com.google.protobuf.InvalidProtocolBufferException {
1210 | return PARSER.parseFrom(data);
1211 | }
1212 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap parseFrom(
1213 | byte[] data,
1214 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1215 | throws com.google.protobuf.InvalidProtocolBufferException {
1216 | return PARSER.parseFrom(data, extensionRegistry);
1217 | }
1218 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap parseFrom(java.io.InputStream input)
1219 | throws java.io.IOException {
1220 | return com.google.protobuf.GeneratedMessageV3
1221 | .parseWithIOException(PARSER, input);
1222 | }
1223 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap parseFrom(
1224 | java.io.InputStream input,
1225 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1226 | throws java.io.IOException {
1227 | return com.google.protobuf.GeneratedMessageV3
1228 | .parseWithIOException(PARSER, input, extensionRegistry);
1229 | }
1230 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap parseDelimitedFrom(java.io.InputStream input)
1231 | throws java.io.IOException {
1232 | return com.google.protobuf.GeneratedMessageV3
1233 | .parseDelimitedWithIOException(PARSER, input);
1234 | }
1235 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap parseDelimitedFrom(
1236 | java.io.InputStream input,
1237 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1238 | throws java.io.IOException {
1239 | return com.google.protobuf.GeneratedMessageV3
1240 | .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
1241 | }
1242 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap parseFrom(
1243 | com.google.protobuf.CodedInputStream input)
1244 | throws java.io.IOException {
1245 | return com.google.protobuf.GeneratedMessageV3
1246 | .parseWithIOException(PARSER, input);
1247 | }
1248 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap parseFrom(
1249 | com.google.protobuf.CodedInputStream input,
1250 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1251 | throws java.io.IOException {
1252 | return com.google.protobuf.GeneratedMessageV3
1253 | .parseWithIOException(PARSER, input, extensionRegistry);
1254 | }
1255 |
1256 | public Builder newBuilderForType() { return newBuilder(); }
1257 | public static Builder newBuilder() {
1258 | return DEFAULT_INSTANCE.toBuilder();
1259 | }
1260 | public static Builder newBuilder(object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap prototype) {
1261 | return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
1262 | }
1263 | public Builder toBuilder() {
1264 | return this == DEFAULT_INSTANCE
1265 | ? new Builder() : new Builder().mergeFrom(this);
1266 | }
1267 |
1268 | @java.lang.Override
1269 | protected Builder newBuilderForType(
1270 | com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
1271 | Builder builder = new Builder(parent);
1272 | return builder;
1273 | }
1274 | /**
1275 | * Protobuf type {@code object_detection.protos.StringIntLabelMap}
1276 | */
1277 | public static final class Builder extends
1278 | com.google.protobuf.GeneratedMessageV3.Builder implements
1279 | // @@protoc_insertion_point(builder_implements:object_detection.protos.StringIntLabelMap)
1280 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapOrBuilder {
1281 | public static final com.google.protobuf.Descriptors.Descriptor
1282 | getDescriptor() {
1283 | return object_detection.protos.StringIntLabelMapOuterClass.internal_static_object_detection_protos_StringIntLabelMap_descriptor;
1284 | }
1285 |
1286 | protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
1287 | internalGetFieldAccessorTable() {
1288 | return object_detection.protos.StringIntLabelMapOuterClass.internal_static_object_detection_protos_StringIntLabelMap_fieldAccessorTable
1289 | .ensureFieldAccessorsInitialized(
1290 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap.class, object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap.Builder.class);
1291 | }
1292 |
1293 | // Construct using object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap.newBuilder()
1294 | private Builder() {
1295 | maybeForceBuilderInitialization();
1296 | }
1297 |
1298 | private Builder(
1299 | com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
1300 | super(parent);
1301 | maybeForceBuilderInitialization();
1302 | }
1303 | private void maybeForceBuilderInitialization() {
1304 | if (com.google.protobuf.GeneratedMessageV3
1305 | .alwaysUseFieldBuilders) {
1306 | getItemFieldBuilder();
1307 | }
1308 | }
1309 | public Builder clear() {
1310 | super.clear();
1311 | if (itemBuilder_ == null) {
1312 | item_ = java.util.Collections.emptyList();
1313 | bitField0_ = (bitField0_ & ~0x00000001);
1314 | } else {
1315 | itemBuilder_.clear();
1316 | }
1317 | return this;
1318 | }
1319 |
1320 | public com.google.protobuf.Descriptors.Descriptor
1321 | getDescriptorForType() {
1322 | return object_detection.protos.StringIntLabelMapOuterClass.internal_static_object_detection_protos_StringIntLabelMap_descriptor;
1323 | }
1324 |
1325 | public object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap getDefaultInstanceForType() {
1326 | return object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap.getDefaultInstance();
1327 | }
1328 |
1329 | public object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap build() {
1330 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap result = buildPartial();
1331 | if (!result.isInitialized()) {
1332 | throw newUninitializedMessageException(result);
1333 | }
1334 | return result;
1335 | }
1336 |
1337 | public object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap buildPartial() {
1338 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap result = new object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap(this);
1339 | int from_bitField0_ = bitField0_;
1340 | if (itemBuilder_ == null) {
1341 | if (((bitField0_ & 0x00000001) == 0x00000001)) {
1342 | item_ = java.util.Collections.unmodifiableList(item_);
1343 | bitField0_ = (bitField0_ & ~0x00000001);
1344 | }
1345 | result.item_ = item_;
1346 | } else {
1347 | result.item_ = itemBuilder_.build();
1348 | }
1349 | onBuilt();
1350 | return result;
1351 | }
1352 |
1353 | public Builder clone() {
1354 | return (Builder) super.clone();
1355 | }
1356 | public Builder setField(
1357 | com.google.protobuf.Descriptors.FieldDescriptor field,
1358 | java.lang.Object value) {
1359 | return (Builder) super.setField(field, value);
1360 | }
1361 | public Builder clearField(
1362 | com.google.protobuf.Descriptors.FieldDescriptor field) {
1363 | return (Builder) super.clearField(field);
1364 | }
1365 | public Builder clearOneof(
1366 | com.google.protobuf.Descriptors.OneofDescriptor oneof) {
1367 | return (Builder) super.clearOneof(oneof);
1368 | }
1369 | public Builder setRepeatedField(
1370 | com.google.protobuf.Descriptors.FieldDescriptor field,
1371 | int index, java.lang.Object value) {
1372 | return (Builder) super.setRepeatedField(field, index, value);
1373 | }
1374 | public Builder addRepeatedField(
1375 | com.google.protobuf.Descriptors.FieldDescriptor field,
1376 | java.lang.Object value) {
1377 | return (Builder) super.addRepeatedField(field, value);
1378 | }
1379 | public Builder mergeFrom(com.google.protobuf.Message other) {
1380 | if (other instanceof object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap) {
1381 | return mergeFrom((object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap)other);
1382 | } else {
1383 | super.mergeFrom(other);
1384 | return this;
1385 | }
1386 | }
1387 |
1388 | public Builder mergeFrom(object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap other) {
1389 | if (other == object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap.getDefaultInstance()) return this;
1390 | if (itemBuilder_ == null) {
1391 | if (!other.item_.isEmpty()) {
1392 | if (item_.isEmpty()) {
1393 | item_ = other.item_;
1394 | bitField0_ = (bitField0_ & ~0x00000001);
1395 | } else {
1396 | ensureItemIsMutable();
1397 | item_.addAll(other.item_);
1398 | }
1399 | onChanged();
1400 | }
1401 | } else {
1402 | if (!other.item_.isEmpty()) {
1403 | if (itemBuilder_.isEmpty()) {
1404 | itemBuilder_.dispose();
1405 | itemBuilder_ = null;
1406 | item_ = other.item_;
1407 | bitField0_ = (bitField0_ & ~0x00000001);
1408 | itemBuilder_ =
1409 | com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
1410 | getItemFieldBuilder() : null;
1411 | } else {
1412 | itemBuilder_.addAllMessages(other.item_);
1413 | }
1414 | }
1415 | }
1416 | this.mergeUnknownFields(other.unknownFields);
1417 | onChanged();
1418 | return this;
1419 | }
1420 |
1421 | public final boolean isInitialized() {
1422 | return true;
1423 | }
1424 |
1425 | public Builder mergeFrom(
1426 | com.google.protobuf.CodedInputStream input,
1427 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1428 | throws java.io.IOException {
1429 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap parsedMessage = null;
1430 | try {
1431 | parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
1432 | } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1433 | parsedMessage = (object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap) e.getUnfinishedMessage();
1434 | throw e.unwrapIOException();
1435 | } finally {
1436 | if (parsedMessage != null) {
1437 | mergeFrom(parsedMessage);
1438 | }
1439 | }
1440 | return this;
1441 | }
1442 | private int bitField0_;
1443 |
1444 | private java.util.List item_ =
1445 | java.util.Collections.emptyList();
1446 | private void ensureItemIsMutable() {
1447 | if (!((bitField0_ & 0x00000001) == 0x00000001)) {
1448 | item_ = new java.util.ArrayList(item_);
1449 | bitField0_ |= 0x00000001;
1450 | }
1451 | }
1452 |
1453 | private com.google.protobuf.RepeatedFieldBuilderV3<
1454 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem, object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem.Builder, object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItemOrBuilder> itemBuilder_;
1455 |
1456 | /**
1457 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1458 | */
1459 | public java.util.List getItemList() {
1460 | if (itemBuilder_ == null) {
1461 | return java.util.Collections.unmodifiableList(item_);
1462 | } else {
1463 | return itemBuilder_.getMessageList();
1464 | }
1465 | }
1466 | /**
1467 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1468 | */
1469 | public int getItemCount() {
1470 | if (itemBuilder_ == null) {
1471 | return item_.size();
1472 | } else {
1473 | return itemBuilder_.getCount();
1474 | }
1475 | }
1476 | /**
1477 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1478 | */
1479 | public object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem getItem(int index) {
1480 | if (itemBuilder_ == null) {
1481 | return item_.get(index);
1482 | } else {
1483 | return itemBuilder_.getMessage(index);
1484 | }
1485 | }
1486 | /**
1487 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1488 | */
1489 | public Builder setItem(
1490 | int index, object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem value) {
1491 | if (itemBuilder_ == null) {
1492 | if (value == null) {
1493 | throw new NullPointerException();
1494 | }
1495 | ensureItemIsMutable();
1496 | item_.set(index, value);
1497 | onChanged();
1498 | } else {
1499 | itemBuilder_.setMessage(index, value);
1500 | }
1501 | return this;
1502 | }
1503 | /**
1504 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1505 | */
1506 | public Builder setItem(
1507 | int index, object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem.Builder builderForValue) {
1508 | if (itemBuilder_ == null) {
1509 | ensureItemIsMutable();
1510 | item_.set(index, builderForValue.build());
1511 | onChanged();
1512 | } else {
1513 | itemBuilder_.setMessage(index, builderForValue.build());
1514 | }
1515 | return this;
1516 | }
1517 | /**
1518 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1519 | */
1520 | public Builder addItem(object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem value) {
1521 | if (itemBuilder_ == null) {
1522 | if (value == null) {
1523 | throw new NullPointerException();
1524 | }
1525 | ensureItemIsMutable();
1526 | item_.add(value);
1527 | onChanged();
1528 | } else {
1529 | itemBuilder_.addMessage(value);
1530 | }
1531 | return this;
1532 | }
1533 | /**
1534 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1535 | */
1536 | public Builder addItem(
1537 | int index, object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem value) {
1538 | if (itemBuilder_ == null) {
1539 | if (value == null) {
1540 | throw new NullPointerException();
1541 | }
1542 | ensureItemIsMutable();
1543 | item_.add(index, value);
1544 | onChanged();
1545 | } else {
1546 | itemBuilder_.addMessage(index, value);
1547 | }
1548 | return this;
1549 | }
1550 | /**
1551 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1552 | */
1553 | public Builder addItem(
1554 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem.Builder builderForValue) {
1555 | if (itemBuilder_ == null) {
1556 | ensureItemIsMutable();
1557 | item_.add(builderForValue.build());
1558 | onChanged();
1559 | } else {
1560 | itemBuilder_.addMessage(builderForValue.build());
1561 | }
1562 | return this;
1563 | }
1564 | /**
1565 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1566 | */
1567 | public Builder addItem(
1568 | int index, object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem.Builder builderForValue) {
1569 | if (itemBuilder_ == null) {
1570 | ensureItemIsMutable();
1571 | item_.add(index, builderForValue.build());
1572 | onChanged();
1573 | } else {
1574 | itemBuilder_.addMessage(index, builderForValue.build());
1575 | }
1576 | return this;
1577 | }
1578 | /**
1579 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1580 | */
1581 | public Builder addAllItem(
1582 | java.lang.Iterable extends object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem> values) {
1583 | if (itemBuilder_ == null) {
1584 | ensureItemIsMutable();
1585 | com.google.protobuf.AbstractMessageLite.Builder.addAll(
1586 | values, item_);
1587 | onChanged();
1588 | } else {
1589 | itemBuilder_.addAllMessages(values);
1590 | }
1591 | return this;
1592 | }
1593 | /**
1594 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1595 | */
1596 | public Builder clearItem() {
1597 | if (itemBuilder_ == null) {
1598 | item_ = java.util.Collections.emptyList();
1599 | bitField0_ = (bitField0_ & ~0x00000001);
1600 | onChanged();
1601 | } else {
1602 | itemBuilder_.clear();
1603 | }
1604 | return this;
1605 | }
1606 | /**
1607 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1608 | */
1609 | public Builder removeItem(int index) {
1610 | if (itemBuilder_ == null) {
1611 | ensureItemIsMutable();
1612 | item_.remove(index);
1613 | onChanged();
1614 | } else {
1615 | itemBuilder_.remove(index);
1616 | }
1617 | return this;
1618 | }
1619 | /**
1620 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1621 | */
1622 | public object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem.Builder getItemBuilder(
1623 | int index) {
1624 | return getItemFieldBuilder().getBuilder(index);
1625 | }
1626 | /**
1627 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1628 | */
1629 | public object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItemOrBuilder getItemOrBuilder(
1630 | int index) {
1631 | if (itemBuilder_ == null) {
1632 | return item_.get(index); } else {
1633 | return itemBuilder_.getMessageOrBuilder(index);
1634 | }
1635 | }
1636 | /**
1637 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1638 | */
1639 | public java.util.List extends object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItemOrBuilder>
1640 | getItemOrBuilderList() {
1641 | if (itemBuilder_ != null) {
1642 | return itemBuilder_.getMessageOrBuilderList();
1643 | } else {
1644 | return java.util.Collections.unmodifiableList(item_);
1645 | }
1646 | }
1647 | /**
1648 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1649 | */
1650 | public object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem.Builder addItemBuilder() {
1651 | return getItemFieldBuilder().addBuilder(
1652 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem.getDefaultInstance());
1653 | }
1654 | /**
1655 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1656 | */
1657 | public object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem.Builder addItemBuilder(
1658 | int index) {
1659 | return getItemFieldBuilder().addBuilder(
1660 | index, object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem.getDefaultInstance());
1661 | }
1662 | /**
1663 | * repeated .object_detection.protos.StringIntLabelMapItem item = 1;
1664 | */
1665 | public java.util.List
1666 | getItemBuilderList() {
1667 | return getItemFieldBuilder().getBuilderList();
1668 | }
1669 | private com.google.protobuf.RepeatedFieldBuilderV3<
1670 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem, object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem.Builder, object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItemOrBuilder>
1671 | getItemFieldBuilder() {
1672 | if (itemBuilder_ == null) {
1673 | itemBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
1674 | object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem, object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItem.Builder, object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMapItemOrBuilder>(
1675 | item_,
1676 | ((bitField0_ & 0x00000001) == 0x00000001),
1677 | getParentForChildren(),
1678 | isClean());
1679 | item_ = null;
1680 | }
1681 | return itemBuilder_;
1682 | }
1683 | public final Builder setUnknownFields(
1684 | final com.google.protobuf.UnknownFieldSet unknownFields) {
1685 | return super.setUnknownFields(unknownFields);
1686 | }
1687 |
1688 | public final Builder mergeUnknownFields(
1689 | final com.google.protobuf.UnknownFieldSet unknownFields) {
1690 | return super.mergeUnknownFields(unknownFields);
1691 | }
1692 |
1693 |
1694 | // @@protoc_insertion_point(builder_scope:object_detection.protos.StringIntLabelMap)
1695 | }
1696 |
1697 | // @@protoc_insertion_point(class_scope:object_detection.protos.StringIntLabelMap)
1698 | private static final object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap DEFAULT_INSTANCE;
1699 | static {
1700 | DEFAULT_INSTANCE = new object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap();
1701 | }
1702 |
1703 | public static object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap getDefaultInstance() {
1704 | return DEFAULT_INSTANCE;
1705 | }
1706 |
1707 | @java.lang.Deprecated public static final com.google.protobuf.Parser
1708 | PARSER = new com.google.protobuf.AbstractParser() {
1709 | public StringIntLabelMap parsePartialFrom(
1710 | com.google.protobuf.CodedInputStream input,
1711 | com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1712 | throws com.google.protobuf.InvalidProtocolBufferException {
1713 | return new StringIntLabelMap(input, extensionRegistry);
1714 | }
1715 | };
1716 |
1717 | public static com.google.protobuf.Parser parser() {
1718 | return PARSER;
1719 | }
1720 |
1721 | @java.lang.Override
1722 | public com.google.protobuf.Parser getParserForType() {
1723 | return PARSER;
1724 | }
1725 |
1726 | public object_detection.protos.StringIntLabelMapOuterClass.StringIntLabelMap getDefaultInstanceForType() {
1727 | return DEFAULT_INSTANCE;
1728 | }
1729 |
1730 | }
1731 |
1732 | private static final com.google.protobuf.Descriptors.Descriptor
1733 | internal_static_object_detection_protos_StringIntLabelMapItem_descriptor;
1734 | private static final
1735 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
1736 | internal_static_object_detection_protos_StringIntLabelMapItem_fieldAccessorTable;
1737 | private static final com.google.protobuf.Descriptors.Descriptor
1738 | internal_static_object_detection_protos_StringIntLabelMap_descriptor;
1739 | private static final
1740 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
1741 | internal_static_object_detection_protos_StringIntLabelMap_fieldAccessorTable;
1742 |
1743 | public static com.google.protobuf.Descriptors.FileDescriptor
1744 | getDescriptor() {
1745 | return descriptor;
1746 | }
1747 | private static com.google.protobuf.Descriptors.FileDescriptor
1748 | descriptor;
1749 | static {
1750 | java.lang.String[] descriptorData = {
1751 | "\n\032string_int_label_map.proto\022\027object_det" +
1752 | "ection.protos\"G\n\025StringIntLabelMapItem\022\014" +
1753 | "\n\004name\030\001 \001(\t\022\n\n\002id\030\002 \001(\005\022\024\n\014display_name" +
1754 | "\030\003 \001(\t\"Q\n\021StringIntLabelMap\022<\n\004item\030\001 \003(" +
1755 | "\0132..object_detection.protos.StringIntLab" +
1756 | "elMapItem"
1757 | };
1758 | com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
1759 | new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
1760 | public com.google.protobuf.ExtensionRegistry assignDescriptors(
1761 | com.google.protobuf.Descriptors.FileDescriptor root) {
1762 | descriptor = root;
1763 | return null;
1764 | }
1765 | };
1766 | com.google.protobuf.Descriptors.FileDescriptor
1767 | .internalBuildGeneratedFileFrom(descriptorData,
1768 | new com.google.protobuf.Descriptors.FileDescriptor[] {
1769 | }, assigner);
1770 | internal_static_object_detection_protos_StringIntLabelMapItem_descriptor =
1771 | getDescriptor().getMessageTypes().get(0);
1772 | internal_static_object_detection_protos_StringIntLabelMapItem_fieldAccessorTable = new
1773 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
1774 | internal_static_object_detection_protos_StringIntLabelMapItem_descriptor,
1775 | new java.lang.String[] { "Name", "Id", "DisplayName", });
1776 | internal_static_object_detection_protos_StringIntLabelMap_descriptor =
1777 | getDescriptor().getMessageTypes().get(1);
1778 | internal_static_object_detection_protos_StringIntLabelMap_fieldAccessorTable = new
1779 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
1780 | internal_static_object_detection_protos_StringIntLabelMap_descriptor,
1781 | new java.lang.String[] { "Item", });
1782 | }
1783 |
1784 | // @@protoc_insertion_point(outer_class_scope)
1785 | }
--------------------------------------------------------------------------------
/src/main/protobuf/string_int_label_map.proto:
--------------------------------------------------------------------------------
1 | // Message to store the mapping from class label strings to class id. Datasets
2 | // use string labels to represent classes while the object detection framework
3 | // works with class ids. This message maps them so they can be converted back
4 | // and forth as needed.
5 | syntax = "proto2";
6 |
7 | package object_detection.protos;
8 |
9 | message StringIntLabelMapItem {
10 | // String name. The most common practice is to set this to a MID or synsets
11 | // id.
12 | optional string name = 1;
13 |
14 | // Integer id that maps to the string name above. Label ids should start from
15 | // 1.
16 | optional int32 id = 2;
17 |
18 | // Human readable string label.
19 | optional string display_name = 3;
20 | };
21 |
22 | message StringIntLabelMap {
23 | repeated StringIntLabelMapItem item = 1;
24 | };
--------------------------------------------------------------------------------
/src/main/resources/labels/mscoco_label_map.pbtxt:
--------------------------------------------------------------------------------
1 | item {
2 | name: "/m/01g317"
3 | id: 1
4 | display_name: "person"
5 | }
6 | item {
7 | name: "/m/0199g"
8 | id: 2
9 | display_name: "bicycle"
10 | }
11 | item {
12 | name: "/m/0k4j"
13 | id: 3
14 | display_name: "car"
15 | }
16 | item {
17 | name: "/m/04_sv"
18 | id: 4
19 | display_name: "motorcycle"
20 | }
21 | item {
22 | name: "/m/05czz6l"
23 | id: 5
24 | display_name: "airplane"
25 | }
26 | item {
27 | name: "/m/01bjv"
28 | id: 6
29 | display_name: "bus"
30 | }
31 | item {
32 | name: "/m/07jdr"
33 | id: 7
34 | display_name: "train"
35 | }
36 | item {
37 | name: "/m/07r04"
38 | id: 8
39 | display_name: "truck"
40 | }
41 | item {
42 | name: "/m/019jd"
43 | id: 9
44 | display_name: "boat"
45 | }
46 | item {
47 | name: "/m/015qff"
48 | id: 10
49 | display_name: "traffic light"
50 | }
51 | item {
52 | name: "/m/01pns0"
53 | id: 11
54 | display_name: "fire hydrant"
55 | }
56 | item {
57 | name: "/m/02pv19"
58 | id: 13
59 | display_name: "stop sign"
60 | }
61 | item {
62 | name: "/m/015qbp"
63 | id: 14
64 | display_name: "parking meter"
65 | }
66 | item {
67 | name: "/m/0cvnqh"
68 | id: 15
69 | display_name: "bench"
70 | }
71 | item {
72 | name: "/m/015p6"
73 | id: 16
74 | display_name: "bird"
75 | }
76 | item {
77 | name: "/m/01yrx"
78 | id: 17
79 | display_name: "cat"
80 | }
81 | item {
82 | name: "/m/0bt9lr"
83 | id: 18
84 | display_name: "dog"
85 | }
86 | item {
87 | name: "/m/03k3r"
88 | id: 19
89 | display_name: "horse"
90 | }
91 | item {
92 | name: "/m/07bgp"
93 | id: 20
94 | display_name: "sheep"
95 | }
96 | item {
97 | name: "/m/01xq0k1"
98 | id: 21
99 | display_name: "cow"
100 | }
101 | item {
102 | name: "/m/0bwd_0j"
103 | id: 22
104 | display_name: "elephant"
105 | }
106 | item {
107 | name: "/m/01dws"
108 | id: 23
109 | display_name: "bear"
110 | }
111 | item {
112 | name: "/m/0898b"
113 | id: 24
114 | display_name: "zebra"
115 | }
116 | item {
117 | name: "/m/03bk1"
118 | id: 25
119 | display_name: "giraffe"
120 | }
121 | item {
122 | name: "/m/01940j"
123 | id: 27
124 | display_name: "backpack"
125 | }
126 | item {
127 | name: "/m/0hnnb"
128 | id: 28
129 | display_name: "umbrella"
130 | }
131 | item {
132 | name: "/m/080hkjn"
133 | id: 31
134 | display_name: "handbag"
135 | }
136 | item {
137 | name: "/m/01rkbr"
138 | id: 32
139 | display_name: "tie"
140 | }
141 | item {
142 | name: "/m/01s55n"
143 | id: 33
144 | display_name: "suitcase"
145 | }
146 | item {
147 | name: "/m/02wmf"
148 | id: 34
149 | display_name: "frisbee"
150 | }
151 | item {
152 | name: "/m/071p9"
153 | id: 35
154 | display_name: "skis"
155 | }
156 | item {
157 | name: "/m/06__v"
158 | id: 36
159 | display_name: "snowboard"
160 | }
161 | item {
162 | name: "/m/018xm"
163 | id: 37
164 | display_name: "sports ball"
165 | }
166 | item {
167 | name: "/m/02zt3"
168 | id: 38
169 | display_name: "kite"
170 | }
171 | item {
172 | name: "/m/03g8mr"
173 | id: 39
174 | display_name: "baseball bat"
175 | }
176 | item {
177 | name: "/m/03grzl"
178 | id: 40
179 | display_name: "baseball glove"
180 | }
181 | item {
182 | name: "/m/06_fw"
183 | id: 41
184 | display_name: "skateboard"
185 | }
186 | item {
187 | name: "/m/019w40"
188 | id: 42
189 | display_name: "surfboard"
190 | }
191 | item {
192 | name: "/m/0dv9c"
193 | id: 43
194 | display_name: "tennis racket"
195 | }
196 | item {
197 | name: "/m/04dr76w"
198 | id: 44
199 | display_name: "bottle"
200 | }
201 | item {
202 | name: "/m/09tvcd"
203 | id: 46
204 | display_name: "wine glass"
205 | }
206 | item {
207 | name: "/m/08gqpm"
208 | id: 47
209 | display_name: "cup"
210 | }
211 | item {
212 | name: "/m/0dt3t"
213 | id: 48
214 | display_name: "fork"
215 | }
216 | item {
217 | name: "/m/04ctx"
218 | id: 49
219 | display_name: "knife"
220 | }
221 | item {
222 | name: "/m/0cmx8"
223 | id: 50
224 | display_name: "spoon"
225 | }
226 | item {
227 | name: "/m/04kkgm"
228 | id: 51
229 | display_name: "bowl"
230 | }
231 | item {
232 | name: "/m/09qck"
233 | id: 52
234 | display_name: "banana"
235 | }
236 | item {
237 | name: "/m/014j1m"
238 | id: 53
239 | display_name: "apple"
240 | }
241 | item {
242 | name: "/m/0l515"
243 | id: 54
244 | display_name: "sandwich"
245 | }
246 | item {
247 | name: "/m/0cyhj_"
248 | id: 55
249 | display_name: "orange"
250 | }
251 | item {
252 | name: "/m/0hkxq"
253 | id: 56
254 | display_name: "broccoli"
255 | }
256 | item {
257 | name: "/m/0fj52s"
258 | id: 57
259 | display_name: "carrot"
260 | }
261 | item {
262 | name: "/m/01b9xk"
263 | id: 58
264 | display_name: "hot dog"
265 | }
266 | item {
267 | name: "/m/0663v"
268 | id: 59
269 | display_name: "pizza"
270 | }
271 | item {
272 | name: "/m/0jy4k"
273 | id: 60
274 | display_name: "donut"
275 | }
276 | item {
277 | name: "/m/0fszt"
278 | id: 61
279 | display_name: "cake"
280 | }
281 | item {
282 | name: "/m/01mzpv"
283 | id: 62
284 | display_name: "chair"
285 | }
286 | item {
287 | name: "/m/02crq1"
288 | id: 63
289 | display_name: "couch"
290 | }
291 | item {
292 | name: "/m/03fp41"
293 | id: 64
294 | display_name: "potted plant"
295 | }
296 | item {
297 | name: "/m/03ssj5"
298 | id: 65
299 | display_name: "bed"
300 | }
301 | item {
302 | name: "/m/04bcr3"
303 | id: 67
304 | display_name: "dining table"
305 | }
306 | item {
307 | name: "/m/09g1w"
308 | id: 70
309 | display_name: "toilet"
310 | }
311 | item {
312 | name: "/m/07c52"
313 | id: 72
314 | display_name: "tv"
315 | }
316 | item {
317 | name: "/m/01c648"
318 | id: 73
319 | display_name: "laptop"
320 | }
321 | item {
322 | name: "/m/020lf"
323 | id: 74
324 | display_name: "mouse"
325 | }
326 | item {
327 | name: "/m/0qjjc"
328 | id: 75
329 | display_name: "remote"
330 | }
331 | item {
332 | name: "/m/01m2v"
333 | id: 76
334 | display_name: "keyboard"
335 | }
336 | item {
337 | name: "/m/050k8"
338 | id: 77
339 | display_name: "cell phone"
340 | }
341 | item {
342 | name: "/m/0fx9l"
343 | id: 78
344 | display_name: "microwave"
345 | }
346 | item {
347 | name: "/m/029bxz"
348 | id: 79
349 | display_name: "oven"
350 | }
351 | item {
352 | name: "/m/01k6s3"
353 | id: 80
354 | display_name: "toaster"
355 | }
356 | item {
357 | name: "/m/0130jx"
358 | id: 81
359 | display_name: "sink"
360 | }
361 | item {
362 | name: "/m/040b_t"
363 | id: 82
364 | display_name: "refrigerator"
365 | }
366 | item {
367 | name: "/m/0bt_c3"
368 | id: 84
369 | display_name: "book"
370 | }
371 | item {
372 | name: "/m/01x3z"
373 | id: 85
374 | display_name: "clock"
375 | }
376 | item {
377 | name: "/m/02s195"
378 | id: 86
379 | display_name: "vase"
380 | }
381 | item {
382 | name: "/m/01lsmm"
383 | id: 87
384 | display_name: "scissors"
385 | }
386 | item {
387 | name: "/m/0kmg4"
388 | id: 88
389 | display_name: "teddy bear"
390 | }
391 | item {
392 | name: "/m/03wvsk"
393 | id: 89
394 | display_name: "hair drier"
395 | }
396 | item {
397 | name: "/m/012xff"
398 | id: 90
399 | display_name: "toothbrush"
400 | }
--------------------------------------------------------------------------------
/src/main/resources/tf_models/saved_model.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chen0040/java-ssd-object-detection/39435c0fbaf9cf6e3d605dc7c4ee8990a8888007/src/main/resources/tf_models/saved_model.zip
--------------------------------------------------------------------------------