Giter Club home page Giter Club logo

example-object-tracker's Introduction

Edge TPU Object Tracker Example

This repo contains a collection of examples that use camera streams together with the TensorFlow Lite API with a Coral device such as the USB Accelerator or Dev Board and provides an Object tracker for use with the detected objects.

Installation

  1. First, be sure you have completed the setup instructions for your Coral device. If it's been a while, repeat to be sure you have the latest software.

    Importantly, you should have the latest TensorFlow Lite runtime installed (as per the Python quickstart).

  2. Clone this Git repo onto your computer:

    mkdir google-coral && cd google-coral
    
    git clone https://github.com/google-coral/example-object-tracker.git
    
    cd example-object-tracker/
    
  3. Download the models:

    sh download_models.sh
    

    These models will be downloaded to a new folder models.

Further requirements may be needed by the different camera libraries, check the README file for the respective subfolder.

Contents

  • gstreamer: Python examples using gstreamer to obtain camera stream. These examples work on Linux using a webcam, Raspberry Pi with the Raspicam, and on the Coral DevBoard using the Coral camera. For the former two, you will also need a Coral USB Accelerator to run the models.

    This demo provides the support of an Object tracker. After following the setup instructions in README file for the subfolder gstreamer, you can run the tracker demo:

    cd gstreamer
    python3 detect.py --tracker sort
    

Models

For the demos in this repository you can change the model and the labels file by using the flags flags --model and --labels. Be sure to use the models labeled _edgetpu, as those are compiled for the accelerator - otherwise the model will run on the CPU and be much slower.

For detection you need to select one of the SSD detection models and its corresponding labels file:

mobilenet_ssd_v2_coco_quant_postprocess_edgetpu.tflite, coco_labels.txt

example-object-tracker's People

Contributors

hjonnala avatar mbrooksx avatar swiftwinds avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

example-object-tracker's Issues

Pretty high system load on RPI 4

Description

Hi, I'm wondering what can make a system load of about 2.5-3 on an RPI. I mean, it is more or less some GStreamer stuff and USB 3 transfer, inference is running in the Coral TPU.

I'm using a USB camera as input (/dev/video1). PI is not overclocked, 2GB RAM

What could cause this high load, any ideas?

Other than that the inference is running fine.

Click to expand!

Issue Type

No response

Operating System

Linux

Coral Device

USB Accelerator

Other Devices

Rapsberry Pi 4

Programming Language

Python 3.9

Relevant Log Output

No response

Failed to prepare for TPU

Description

I tried to retrain an "EfficientDet-Lite" detection with the "Retrain EfficientDet-Lite detector for the Edge TPU (TF2)" guide (https://colab.research.google.com/github/google-coral/tutorials/blob/master/retrain_efficientdet_model_maker_tf2.ipynb) and to use it with this example object tracker.
When I try to execute the detect.py file with the retrained model, I get the error: "Failed to prepare for TPU". Does somebody know a solution for this problem? Or is there any other option to retrain a model to use it with this detect.py file?

Click to expand!

Issue Type

Support

Operating System

Mendel Linux

Coral Device

Dev Board Mini, Coral Camera

Other Devices

No response

Programming Language

Python 3.7

Relevant Log Output

RuntimeError: Failed to prepare for TPU. Failed precondition: Package requires runtime version (14), which is newer than this runtime version (13).Node number 4 (EdgeTpuDelegateForCustomOp) failed to prepare.

Saving output to file instead of display device (DevBoard)

I am new to GStreamer, and cannot find a correct way to save output to file instead of display device on Coral DevBoard. While using Raspberry Pi and USB Accelerator I managed to save output file successfully but have no luck with DevBoard and OpenGL elements in the pipeline:

I modified output queue from:

        PIPELINE += """ ! decodebin ! glupload ! tee name=t
            t. ! queue ! glfilterbin filter=glbox name=glbox ! {sink_caps} ! {sink_element}
            t. ! queue ! glsvgoverlaysink name=overlaysink
        """

to

        PIPELINE += """ ! decodebin ! glupload ! tee name=t
            t. ! queue ! glfilterbin filter=glbox name=glbox ! {sink_caps} ! {sink_element}
            t. ! queue ! gldownload ! videoconvert ! x264enc ! mp4mux ! filesink location=output.mp4
        """

but am now receiving error and video is not recorded:

** (detect.py:8003): CRITICAL **: 20:08:07.765: gst_video_frame_map_id: assertion 'info->finfo->format == meta->format' failed

Appreciate any advice.

unable to run example-object-tracker on new device

Hello,
Noob here. I've been trying to get the coral mini dev board to run the example-object-tracker. I've followed all instructions from set up of the device to loading the instructions. Other examples for the dev board work fine. Here's the error I'm getting

mendel@green-orange:~/google-coral/example-object-tracker/gstreamer$ python3 detect.py

(detect.py:1322): dconf-WARNING **: 13:21:55.165: Unable to open /usr/local/share/dconf/profile/user: Not a directory
Loading ../models/mobilenet_ssd_v2_coco_quant_postprocess_edgetpu.tflite with ../models/coco_labels.txt labels.
Gstreamer pipeline:
v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480,framerate=30/1 ! tee name=t
t. ! queue max-size-buffers=1 leaky=downstream ! videoconvert ! videoscale ! video/x-raw,width=300,height=225 ! videobox name=box autocrop=true
! video/x-raw,format=RGB,width=300,height=300 ! appsink name=appsink emit-signals=true max-buffers=1 drop=true
t. ! queue max-size-buffers=1 leaky=downstream ! videoconvert
! rsvgoverlay name=overlay ! videoconvert ! ximagesink sync=false

Traceback (most recent call last):
File "detect.py", line 218, in
main()
File "detect.py", line 214, in main
videofmt=args.videofmt)
File "/home/mendel/google-coral/example-object-tracker/gstreamer/gstreamer.py", line 275, in run_pipeline
pipeline = GstPipeline(pipeline, user_function, src_size, mot_tracker)
File "/home/mendel/google-coral/example-object-tracker/gstreamer/gstreamer.py", line 39, in init
self.pipeline = Gst.parse_launch(pipeline)
gi.repository.GLib.Error: gst_parse_error: no element "ximagesink" (1)

Coral Dev Mini Support - PVR Error

Description

I have tried to modify the gstreamer pipeline using examples-camera/gstreamer as follow:

            scale_caps = 'video/x-raw,format=BGRA,width={w},height={h}'.format(w=src_size[0], h=src_size[1])
            PIPELINE += """ ! decodebin ! queue ! v4l2convert ! {scale_caps} !
              glupload ! glcolorconvert ! video/x-raw(memory:GLMemory),format=RGBA !
              tee name=t
                t. ! queue ! glfilterbin filter=glbox name=glbox ! queue ! {sink_caps} ! {sink_element}
                t. ! queue ! glsvgoverlay name=gloverlay sync=false ! glimagesink fullscreen=true
                     qos=false sync=false
            """

However, when running the "python3 detect.py --tracker sort", the following error occurred:

(1795) PVR:(Error): ScheduleTA: Skipping render from different gc/thread! [ :0 ]

Any ideas on the PVR error?

Click to expand!

Issue Type

Support

Operating System

Mendel Linux

Coral Device

Dev Board Mini

Other Devices

No response

Programming Language

Python 3.7

Relevant Log Output

$ python3 detect.py --tracker sort

(detect.py:1778): dconf-WARNING **: 08:32:48.406: Unable to open /usr/local/share/dconf/profile/user: Not a directory
Loading ../models/mobilenet_ssd_v2_coco_quant_postprocess_edgetpu.tflite with ../models/coco_labels.txt labels.
Gstreamer pipeline:
 v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480,framerate=30/1 ! decodebin ! queue ! v4l2convert ! video/x-raw,format=BGRA,width=640,height=480 !
              glupload ! glcolorconvert ! video/x-raw(memory:GLMemory),format=RGBA !
              tee name=t
                t. ! queue ! glfilterbin filter=glbox name=glbox ! queue ! video/x-raw,format=RGB,width=300,height=300 ! appsink name=appsink emit-signals=true max-buffers=1 drop=true
                t. ! queue ! glsvgoverlay name=gloverlay sync=false ! glimagesink fullscreen=true
                     qos=false sync=false
            
(1795) PVR:(Error): ScheduleTA: Skipping render from different gc/thread! [ :0 ]

Error while processing websocket request

I am fooling around with the tooling and noted the following:

  1. run the samples with
  2. edgetpu_detect_server --model mobilenet_ssd_v2_coco_quant_postprocess_edgetpu.tflite --labels coco_labels.txt --filter person,car,truck,bus,motocycle,bicycle --threshold 0.4 --print
  3. Normally everything works fine and I watch my output on 192.168.0.7:4664
  4. But sometimes the whole thing crashes with the following output:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/edgetpuvision/gstreamer.py", line 230, in on_new_sample
    command=custom_command)
  File "/usr/lib/python3/dist-packages/edgetpuvision/camera.py", line 43, in render_overlay
    self.render_overlay(tensor, layout, command)
  File "/usr/lib/python3/dist-packages/edgetpuvision/apps.py", line 48, in render_overlay
    overlay = gen.send((tensor, layout, command))
StopIteration
INFO:edgetpuvision.streaming.server:Server is shutting down
INFO:edgetpuvision.streaming.server:Camera stop recording
INFO:edgetpuvision.streaming.server:[192.168.0.1:60322] Stopping...
ERROR:edgetpuvision.streaming.server:[192.168.0.1:60322] Error while processing websocket request
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/edgetpuvision/streaming/server.py", line 584, in _receive_message
    packet = self._receive_packet()
  File "/usr/lib/python3/dist-packages/edgetpuvision/streaming/server.py", line 626, in _receive_packet
    packet.fin = buf[0] & 0x80 > 0
IndexError: index out of range
INFO:edgetpuvision.streaming.server:[192.168.0.1:60322] Tx thread finished
INFO:edgetpuvision.streaming.server:[192.168.0.1:60322] Rx thread finished
INFO:edgetpuvision.streaming.server:[192.168.0.1:60322] Stopped.
INFO:edgetpuvision.streaming.server:[192.168.0.1:35718] Stopping...
INFO:edgetpuvision.streaming.server:[192.168.0.1:35718] Tx thread finished
ERROR:edgetpuvision.streaming.server:[192.168.0.1:35718] Error while processing websocket request
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/edgetpuvision/streaming/server.py", line 584, in _receive_message
    packet = self._receive_packet()
  File "/usr/lib/python3/dist-packages/edgetpuvision/streaming/server.py", line 626, in _receive_packet
    packet.fin = buf[0] & 0x80 > 0
IndexError: index out of range
INFO:edgetpuvision.streaming.server:[192.168.0.1:35718] Rx thread finished
INFO:edgetpuvision.streaming.server:[192.168.0.1:35718] Stopped.
INFO:edgetpuvision.streaming.server:Done
    0: Object(id=0, score=0.58203125, bbox=BBox(xmin=143, ymin=170, xmax=153, ymax=193)), area=230.00
Traceback (most recent call last):
  File "/usr/bin/edgetpu_detect_server", line 11, in <module>
    load_entry_point('edgetpuvision==7.0', 'console_scripts', 'edgetpu_detect_server')()
  File "/usr/lib/python3/dist-packages/edgetpuvision/detect_server.py", line 33, in main
    run_server(add_render_gen_args, render_gen)
  File "/usr/lib/python3/dist-packages/edgetpuvision/apps.py", line 52, in run_server
    signal.pause()
KeyboardInterrupt
  1. After this I kill the commandline and restart and everything is fine again.
  2. I think this happens if the stream is opened and closed from different Browsers. Opening the stream via 192.168.0.7:4664 starts the recording and if you close the browser windows it stops the recording. So then the process seems to crash if that happens by several different open browser windows.
  3. Is there an option to run this as a background process?

Video is different shades of red

Description

The video is streaming only using shades of red. How do I correct this? In my other apps is streams in full color. I am using a Raspberry PI 4

Click to expand!

Issue Type

Bug

Operating System

Linux

Coral Device

USB Accelerator

Other Devices

No response

Programming Language

Python 3.9

Relevant Log Output

No response

unable to run with tracker

when using tracker and the sort method there seems to be a issue with ...

Requirement already satisfied: isort in /usr/lib/python3/dist-packages (4.3.4)

File "/home/pi/google-coral/example-object-tracker/gstreamer/tracker.py", line 41, in __init__
    from sort import Sort
ModuleNotFoundError: No module named 'sort'

Reason for using gstreamer

Just wanted to ask about choices in this example - why is Gstreamer library chosen instead of OpenCV? It seems to me that Gstreamer is more popular as a native C++ library, instead of Python bindings version and offers advanced functionality which is not really required in object detection/tracking example.

There are very few gstreamer-python related tutorials/documentation out there so I believe learning curve to fully understand code used in example would be quite long.

To be honest, this is first time I am working with Gstreamer and I have spent few hours learning about it. I have managed to grasp basics about building pipelines and connecting them with Gtk application. Are there any performance or other reasons why gstreamer is chosen over opencv? Or my thought process is very wrong here? Thanks in advance for any explanations.

This example doesn't work too

Description

This example doesn't work too
ModuleNotFoundError: No module named 'gi'
It is installed on miniconda, gi module is there but it can't find it
Yolo also uses gstream but it works

Click to expand!

Issue Type

Bug, Build/Install, Support, Documentation Feature Request, Documentation Bug

Operating System

Ubuntu

Coral Device

M.2 Accelerator A+E

Other Devices

No response

Programming Language

Python 3.9

Relevant Log Output

ModuleNotFoundError: No module named 'gi'

ModuleNotFoundError: No module named 'sort'

Description

Getting the following from a Raspberry pi 4B. Doesn't appear to be any such module called "sort".

/google-coral/example-object-tracker/gstreamer $ python detect.py --tracker sort
Loading ../models/mobilenet_ssd_v2_coco_quant_postprocess_edgetpu.tflite with ../models/coco_labels.txt labels.
Traceback (most recent call last):
File "/home/Merida/google-coral/example-object-tracker/gstreamer/detect.py", line 218, in
main()
File "/home/Merida/google-coral/example-object-tracker/gstreamer/detect.py", line 209, in main
result = gstreamer.run_pipeline(user_callback,
File "/home/Merida/google-coral/example-object-tracker/gstreamer/gstreamer.py", line 239, in run_pipeline
objectOfTracker = ObjectTracker(trackerName)
File "/home/Merida/google-coral/example-object-tracker/gstreamer/tracker.py", line 32, in init
self.trackerObject = SortTracker()
File "/home/Merida/google-coral/example-object-tracker/gstreamer/tracker.py", line 41, in init
from sort import Sort
ModuleNotFoundError: No module named 'sort'
Merida@Merida:
/google-coral/example-object-tracker/gstreamer $ pip install sort
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
ERROR: Could not find a version that satisfies the requirement sort
ERROR: No matching distribution found for sort

Click to expand!

Issue Type

Bug

Operating System

Linux

Coral Device

USB Accelerator

Other Devices

No response

Programming Language

Python 3.9

Relevant Log Output

No response

Problem with installing svgwrite

Description

I ran
python3 -m pip install svgwrite
as indicated in another issue as a fix for
ModuleNotFoundError: No module named 'svgwrite'
but that resulted in this error:
Collecting svgwrite Exception: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 143, in main status = self.run(options, args) File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 338, in run resolver.resolve(requirement_set) File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 102, in resolve self._resolve_one(requirement_set, req) File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 256, in _resolve_one abstract_dist = self._get_abstract_dist_for(req_to_install) File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 209, in _get_abstract_dist_for self.require_hashes File "/usr/lib/python3/dist-packages/pip/_internal/operations/prepare.py", line 218, in prepare_linked_requirement req.populate_link(finder, upgrade_allowed, require_hashes) File "/usr/lib/python3/dist-packages/pip/_internal/req/req_install.py", line 164, in populate_link self.link = finder.find_requirement(self, upgrade) File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 572, in find_requirement all_candidates = self.find_all_candidates(req.name) File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 534, in find_all_candidates self._package_versions(page.iter_links(), search) File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 702, in _package_versions v = self._link_package_versions(link, search) File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 777, in _link_package_versions support_this_python = check_requires_python(link.requires_python) File "/usr/lib/python3/dist-packages/pip/_internal/utils/packaging.py", line 33, in check_requires_python return python_version in requires_python_specifier File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/specifiers.py", line 676, in __contains__ return self.contains(item) File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/specifiers.py", line 681, in contains item = parse(item) File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/version.py", line 28, in parse return Version(version) File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/version.py", line 219, in __init__ match = self._regex.search(version) TypeError: expected string or bytes-like object

I added the error also in the output log of this issue.

Click to expand!

Issue Type

Build/Install

Operating System

Mendel Linux

Coral Device

Dev Board

Other Devices

No response

Programming Language

Python 3.7

Relevant Log Output

Collecting svgwrite
Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 143, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 338, in run
    resolver.resolve(requirement_set)
  File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 102, in resolve
    self._resolve_one(requirement_set, req)
  File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 256, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 209, in _get_abstract_dist_for
    self.require_hashes
  File "/usr/lib/python3/dist-packages/pip/_internal/operations/prepare.py", line 218, in prepare_linked_requirement
    req.populate_link(finder, upgrade_allowed, require_hashes)
  File "/usr/lib/python3/dist-packages/pip/_internal/req/req_install.py", line 164, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 572, in find_requirement
    all_candidates = self.find_all_candidates(req.name)
  File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 534, in find_all_candidates
    self._package_versions(page.iter_links(), search)
  File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 702, in _package_versions
    v = self._link_package_versions(link, search)
  File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 777, in _link_package_versions
    support_this_python = check_requires_python(link.requires_python)
  File "/usr/lib/python3/dist-packages/pip/_internal/utils/packaging.py", line 33, in check_requires_python
    return python_version in requires_python_specifier
  File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/specifiers.py", line 676, in __contains__
    return self.contains(item)
  File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/specifiers.py", line 681, in contains
    item = parse(item)
  File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/version.py", line 28, in parse
    return Version(version)
  File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/version.py", line 219, in __init__
    match = self._regex.search(version)
TypeError: expected string or bytes-like object

Running with a Jetson Nano and USB Accelerator

Hello. Thank you for the great example. I have a few questions regarding object trackers running on the Coral Accelerator attached to a Jetson Nano.

  1. What is the speed of the tracker? I followed this repository for a DeepSORT tracker combined with MobileNet SSD, but the speeds were barely close to 2 FPS.
  2. I am sorry if this is a dumb question, but how do you modify the Gstreamer code to read from and save output to a video file?
  3. I have been trying to create a YOLOv4 + DeepSORT object tracker. Do you think that will provide realtime speeds on the Coral USB accelerator, or is the MobileNet version better, since it seems to be better supported by Coral?

Thank you for your help.

No install script for tracker

Description

The tracking software is a third party module.
In the README it is stated that the module will be downloaded when running install requirements.
However, there is no such installation script.
The only script is for downloading the models.

Click to expand!

Issue Type

Build/Install, Documentation Bug

Operating System

Mendel Linux

Coral Device

Dev Board

Other Devices

No response

Programming Language

Python 3.7

Relevant Log Output

No response

Segmentation Fault during GStreamer Pipeline

Description

I am not completely sure what is going on here. I am unexperienced with the Coral AI Board. It seems that there is a segmentation fault while trying to setup the GStreamer Pipeline.

Click to expand!

Issue Type

Build/Install

Operating System

Windows 10, Mendel Linux

Coral Device

Dev Board

Other Devices

No response

Programming Language

Python 3.7

Relevant Log Output

<e-coral/example-object-tracker/gstreamer$ python3 detect.py
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
Loading ../models/mobilenet_ssd_v2_coco_quant_postprocess_edgetpu.tflite with ../models/coco_l
abels.txt labels.
Detected Edge TPU dev board.
Gstreamer pipeline:
 v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480,framerate=30/1 ! decodebin ! gl
upload ! tee name=t
            t. ! queue ! glfilterbin filter=glbox name=glbox ! video/x-raw,format=RGB,width=30
0,height=300 ! appsink name=appsink emit-signals=true max-buffers=1 drop=true
            t. ! queue ! glsvgoverlaysink name=overlaysink


(detect.py:7609): Gtk-←[1;35mCRITICAL←[0m **: ←[34m19:19:22.005←[0m: _gtk_style_provider_priva
te_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed

(detect.py:7609): Gtk-←[1;35mCRITICAL←[0m **: ←[34m19:19:22.006←[0m: _gtk_style_provider_priva
te_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed

(detect.py:7609): Gtk-←[1;35mCRITICAL←[0m **: ←[34m19:19:22.006←[0m: _gtk_style_provider_priva
te_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
Segmentation fault
mendel@elusive-mole:~/google-coral/example-object-tracker/gstreamer$

Colour-space displaying incorrectly

I seem to get inverted colours when using this with some cameras (i.e. classic purple skin look).

I've attempted adjusting the sink caps (BGR) in the GStreamer video convert and also tried adjusting the v412 driver's pixel format (v4l2-ctl -v pixelformat=UYVY or v4l2-ctl -v pixelformat=RGB3) - but no luck.

Opening a regular GStreamer sink displays correctly coloured video - i.e. gst-launch-1.0 v4l2src ! "video/x-raw,framerate=30/1,format=UYVY" ! v4l2h264enc extra-controls="controls,h264_profile=4,h264_level=10,video_bitrate=256000;" ! video/x-h264,profile=high ! h264parse ! queue ! matroskamux ! filesink location=foo.mkv

Anyone else had this issue?

Send to udp sink

Description

Sending it to udp sink i get error:

Warning: gst-resource-error-quark: Attempting to send a UDP packets larger than maximum size (1228800 > 65507)

Probably need to use RTP but really don't know where to edit detect.py to make use of rtp to segment packets.

Click to expand!

Issue Type

No response

Operating System

No response

Coral Device

No response

Other Devices

No response

Programming Language

No response

Relevant Log Output

No response

install_requirements.sh errors out: fatal error: Python.h

Description

New install of Coral and this project. Ran bash gstreamer/install_requirements.sh and script errored out with:

 aarch64-linux-gnu-g++: lap/lapmod.cpp
   lap/_lapjv.cpp:4:10: fatal error: Python.h: No such file or directory
    #include "Python.h"
             ^~~~~~~~~~
   compilation terminated.

Source: line 184 et seq. from gstreamer_install_attemp_1.script.txt (uploaded).

I then performed:

 sudo apt install python3-dev

then reran bash install_requirements.sh which then succeeded; see log at gstreamer_install_attempt_2.script.txt
gstreamer_install_attemp_1.script.txt
gstreamer_install_attempt_2.script.txt

Click to expand!

Issue Type

Build/Install

Operating System

Mendel Linux

Coral Device

Dev Board

Other Devices

No response

Programming Language

No response

Relevant Log Output

aarch64-linux-gnu-g++: lap/lapmod.cpp
    lap/_lapjv.cpp:4:10: fatal error: Python.h: No such file or directory
     #include "Python.h"
              ^~~~~~~~~~
    compilation terminated.

How do I use a video as an input instead of the camera

Description

I changed the src path to a video saved on the Coral dev mini however I get this error even after converting the video to the required format
Traceback (most recent call last):
File "detect11.py", line 404, in
main()
File "detect11.py", line 400, in main
videofmt=args.videofmt)
File "/home/mendel/google-coral/example-object-tracker/gstreamer/gstreamer.py", line 275, in run_pipeline
pipeline = GstPipeline(pipeline, user_function, src_size, mot_tracker)
File "/home/mendel/google-coral/example-object-tracker/gstreamer/gstreamer.py", line 39, in init
self.pipeline = Gst.parse_launch(pipeline)
gi.repository.GLib.Error: gst_parse_error: could not link videoscale0 to queue1, videoscale0 can't handle caps video/x-h264, width=(int)640, height=(int)480, framerate=(fraction)30/1 (3)

Click to expand!

Issue Type

Support

Operating System

Mendel Linux

Coral Device

Dev Board

Other Devices

No response

Programming Language

Python 3.7

Relevant Log Output

Traceback (most recent call last):
  File "detect11.py", line 404, in <module>
    main()
  File "detect11.py", line 400, in main
    videofmt=args.videofmt)
  File "/home/mendel/google-coral/example-object-tracker/gstreamer/gstreamer.py", line 275, in run_pipeline
    pipeline = GstPipeline(pipeline, user_function, src_size, mot_tracker)
  File "/home/mendel/google-coral/example-object-tracker/gstreamer/gstreamer.py", line 39, in __init__
    self.pipeline = Gst.parse_launch(pipeline)
gi.repository.GLib.Error: gst_parse_error: could not link videoscale0 to queue1, videoscale0 can't handle caps video/x-h264, width=(int)640, height=(int)480, framerate=(fraction)30/1 (3)

rtsp source is not working

Could you give a command line example of how to change video source to rtsp?
Although I tried many times, I could not run this command.

Thank you very much in advance, looking forward to your
I also add the error I got below.

WhatsApp Image 2021-03-05 at 15 15 30

Trying to periodically switch off camera in detect.py

Description

I am using the coral dev mini with a coral camera. I am trying to switch of the camera off in detect.py when there are no people in the frame "if labels.get(obj.id,obj.id) != 'person'" to save power . However I am not sure how to switch the camera off, setting the video source to none instead of /dev/video0 "parser.add_argument('--videosrc', help='Which video source to use. ', default='/dev/video0')" when calling gstreamer.run_pipeline gives me an error. Do you have any suggestions. Thanks.

Click to expand!

Issue Type

Support

Operating System

Mendel Linux

Coral Device

Dev Board Mini

Other Devices

No response

Programming Language

Python 3.7

Relevant Log Output

No response

ModuleNotFoundError: No module named 'sort'

I have a "No module named 'sort''" error when I run "python3 detect.py --tracker sort". I upgraded setuptools and sort, but It seems to be any other third party library. Any hint?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.