ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Home
    2. ssansoy
    S
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 3
    • Best 0
    • Controversial 0
    • Groups 0

    ssansoy

    @ssansoy

    0
    Reputation
    4
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    ssansoy Unfollow Follow

    Latest posts made by ssansoy

    • no data being piped thru /run/mpa/tflite_data

      i wrote a small c program to extract object detection data from /run/mpa/tflite_data

      when I list the contents of tflite_data i get two files: info & request.

      when i "cat /run/mpa/tflite_data/info" i get the the correct data type of ai_detection_t

      when i "cat /run/mpa/tflite_data/request" the system just hangs as if waiting for data

      I know data is being sent as the tflite camera is showing object detections in the web interface

      here is my simple c program

      #include <stdio.h>
      #include <stdlib.h>
      #include <unistd.h>
      #include <fcntl.h>
      #include <string.h>
      #include <stdint.h>
      #include <sys/types.h>
      #include <sys/stat.h>

      #define BUF_LEN 32
      #define MAX_DETECTIONS 100
      #define PIPE_PATH "/run/mpa/tflite_data/request"

      typedef struct ai_detection_t {
      uint32_t magic_number;
      int64_t timestamp_ns;
      uint32_t class_id;
      int32_t frame_id;
      char class_name[BUF_LEN];
      char cam[BUF_LEN];
      float class_confidence;
      float detection_confidence;
      float x_min;
      float y_min;
      float x_max;
      float y_max;
      } attribute((packed)) ai_detection_t;

      int open_pipe(const char* path) {
      int fd = open(path, O_RDONLY);
      if (fd < 0) {
      perror("Failed to open pipe");
      exit(EXIT_FAILURE);
      }
      return fd;
      }

      ssize_t read_pipe(int fd, void* buffer, size_t size) {
      return read(fd, buffer, size);
      }

      int main() {
      int pipe_fd = open_pipe(PIPE_PATH);

      ai_detection_t detections[MAX_DETECTIONS];
      ssize_t bytes_read;
      
      while (1) {
          bytes_read = read_pipe(pipe_fd, detections, sizeof(detections));
          if (bytes_read <= 0) {
              usleep(10000);
              continue;
          }
      
          int num_detections = bytes_read / sizeof(ai_detection_t);
      
          printf("\nReceived %d detections:\n", num_detections);
      
          for (int i = 0; i < num_detections; ++i) {
              ai_detection_t *det = &detections[i];
              printf("Detection %d:\n", i + 1);
              printf("  Magic Number:        0x%X\n", det->magic_number);
              printf("  Timestamp (ns):       %ld\n", det->timestamp_ns);
              printf("  Frame ID:             %d\n", det->frame_id);
              printf("  Class ID:             %u\n", det->class_id);
              printf("  Class Name:           %s\n", det->class_name);
              printf("  Camera Name:          %s\n", det->cam);
              printf("  Class Confidence:     %.2f\n", det->class_confidence);
              printf("  Detection Confidence: %.2f\n", det->detection_confidence);
              printf("  Bounding Box (x_min,y_min,x_max,y_max): (%.2f, %.2f, %.2f, %.2f)\n",
                     det->x_min, det->y_min, det->x_max, det->y_max);
          }
      
          usleep(10000);
      }
      
      close(pipe_fd);
      return 0;
      

      }

      The code just hangs waiting for data to come in from the pipe /run/mpa/tflite_data/request

      what am i doing wrong?

      posted in Ask your questions right here!
      S
      ssansoy
    • latest yolov5 and tflite too many detection boxes.

      output.png

      i've trained yolov5 models in the past that worked well in voxl2s tflite environment

      Something changed in maybe the latest Voxl sdk or in the way ultralytics is generating Yolov5 models during training.
      which cause the multiple nonsensical detection boxes in the image.

      i was able to reproduce this error with the yolov8 model by including the wrong number of classes in yolov8_label.txt .

      so i assumed the same with yolov5 but no matter what number of classes are in yolov5_labels.txt i get the multiple boxes.

      posted in Ask your questions right here!
      S
      ssansoy
    • tFlite not working with Hires Camera

      I'm able to get tFlite to work with the tracking camera but can't get it to work with Hires camera (M0025-2).

      i've tried with all the standard tflite models that come with the system but to no avail.

      Sabri

      tflite_1.jpg
      voxl-tflite_server.conf.png
      voxl-inspect-services.png
      multicam.jpg

      posted in Support Request Format for Best Results
      S
      ssansoy