You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

backbone.cs 1.0 kB

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using Tensorflow;
  5. using static Tensorflow.Binding;
  6. namespace TensorFlowNET.Examples.ImageProcessing.YOLO
  7. {
  8. class backbone
  9. {
  10. public static (Tensor, Tensor, Tensor) darknet53(Tensor input_data, Tensor trainable)
  11. {
  12. return tf_with(tf.variable_scope("darknet"), scope =>
  13. {
  14. input_data = common.convolutional(input_data, filters_shape: new int[] { 3, 3, 3, 32 }, trainable: trainable, name: "conv0");
  15. input_data = common.convolutional(input_data, filters_shape: new int[] { 3, 3, 32, 64 }, trainable: trainable, name: "conv1", downsample: true);
  16. foreach (var i in range(1))
  17. input_data = common.residual_block(input_data, 64, 32, 64, trainable: trainable, name: $"residual{i + 0}");
  18. var route_1 = input_data;
  19. var route_2 = input_data;
  20. return (route_1, route_2, input_data);
  21. });
  22. }
  23. }
  24. }