hailo-ai / hailo-rpi5-examples

MIT License
385 stars 59 forks source link

Fix #37: Add rapidjson-dev dependency and fix compilation issues #38

Closed chm10 closed 2 months ago

chm10 commented 3 months ago

This pull request proposes a solution to address issue #37 and #34 by adding the missing rapidjson-dev package and fixing related compilation issues.

Proposed changes:

  1. Add instruction to install rapidjson-dev package using apt-get
  2. Update references to library packages to ensure correct dependencies
  3. Fix several compilation warnings
  4. Resolve compilation errors related to the missing package

To test these changes:

  1. Install the rapidjson-dev package: sudo apt-get install rapidjson-dev
  2. Rebuild the project
  3. Verify that all compilation warnings and errors are resolved

These changes aim to improve the build process and potentially resolve the issues reported in #37.

Disclaimer: I am not the owner or maintainer of this project. This pull request is a suggested solution based on the information available in issue #37. It is provided "as is", without warranty of any kind, express or implied. The project maintainers should review and test these changes thoroughly before considering implementation. I'm open to feedback and further modifications if needed.

chm10 commented 3 months ago

I tested on /home/user/hailo-rpi5-examples folder need to be there.

After reinstalling

sudo apt-get install --reinstall hailo-tappas-core-3.28.2

Install the compiled package.

$ cd build.release/
$ sudo ninja install

After you can reboot run . setup_env.sh

Go back to the project folder.

$. setup_env.sh
Setting up the environment...
Setting up the environment for hailo-tappas-core...
TAPPAS_VERSION is 3.28.2. Proceeding...
You are not in the venv_hailo_rpi5_examples virtual environment.
Virtual environment exists. Activating...
TAPPAS_POST_PROC_DIR set to /usr/lib/aarch64-linux-gnu/hailo/tappas//post-process/
Device Architecture is set to: HAILO8L

You need to be same folder like /home/user/hailo-rpi5-examples

$ python basic_pipelines/detection.py --help
usage: detection.py [-h] [--input INPUT] [--use-frame] [--show-fps] [--disable-sync] [--dump-dot] [--network {yolov6n,yolov8s,yolox_s_leaky}] [--hef-path HEF_PATH]
                    [--labels-json LABELS_JSON]

Hailo App Help

options:
  -h, --help            show this help message and exit
  --input INPUT, -i INPUT
                        Input source. Can be a file, USB or RPi camera (CSI camera module). For RPi camera use '-i rpi' (Still in Beta). Defaults to /dev/video0
  --use-frame, -u       Use frame from the callback function
  --show-fps, -f        Print FPS on sink
  --disable-sync        Disables display sink sync, will run as fast as possible. Relevant when using file source.
  --dump-dot            Dump the pipeline graph to a dot file pipeline.dot
  --network {yolov6n,yolov8s,yolox_s_leaky}
                        Which Network to use, default is yolov6n
  --hef-path HEF_PATH   Path to HEF file
  --labels-json LABELS_JSON
                        Path to costume labels JSON file
giladnah commented 3 months ago

@chm10 Thanks alot for that PR (and others). I would add rapidjson-dev as a dependency of our installer for future releases. I don't get issues building this on the RPi did you installed hailo using the 'apt install hailo-all'? All dependencies should be resolved from the TAPPAS core package using: postprocess_dep = dependency('hailo-tappas-core', version : '>=3.28.2', required : false) or: postprocess_dep = dependency('hailo_tappas', version : '>=3.28.0')

chm10 commented 3 months ago

@chm10 Thanks alot for that PR (and others). I would add rapidjson-dev as a dependency of our installer for future releases. I don't get issues building this on the RPi did you installed hailo using the 'apt install hailo-all'? All dependencies should be resolved from the TAPPAS core package using: postprocess_dep = dependency('hailo-tappas-core', version : '>=3.28.2', required : false) or: postprocess_dep = dependency('hailo_tappas', version : '>=3.28.0')

Yes, I followed the documentation process, and have issue to install. I runapt install hailo-all following the step-by-step tutorial. The raspeberry 5 have compilation error to compile compile_postprocess.sh. As mentioned by anothers users.

Maybe the two files I modified need some review beucase have issue inside of them.