Giter Site home page Giter Site logo

xeonqq / co-pilot Goto Github PK

View Code? Open in Web Editor NEW
20.0 20.0 5.0 68.5 MB

Machine Learning Based Real-Time Traffic Light Alert on Your Car with Raspberrypi

Home Page: https://xeonqq.github.io/machine%20learning/rpi-coral-traffic-light-alert-en/

License: GNU General Public License v3.0

Python 97.52% Shell 1.10% Dockerfile 1.37%
coral-tpu dashcam maching-learning motion-detection raspberry-pi ssd surveillance traffic-light-classification traffic-light-detection

co-pilot's People

Contributors

xeonqq avatar

Stargazers

 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

co-pilot's Issues

Suggest to loosen the dependency on transitions

Dear developers,

Your project co-pilot requires "transitions==0.8.10" in its dependency. After analyzing the source code, we found that the following versions of transitions can also be suitable without affecting your project, i.e., transitions 0.8.11. Therefore, we suggest to loosen the dependency on transitions from "transitions==0.8.10" to "transitions>=0.8.10,<=0.8.11" to avoid any possible conflict for importing more packages or for downstream projects that may use ddos_script.

May I pull a request to further loosen the dependency on transitions?

By the way, could you please tell us whether such dependency analysis may be potentially helpful for maintaining dependencies easier during your development?



Details:

Your project (commit id: 4da7ed6) directly uses 2 APIs from package transitions.

transitions.core.Machine.__init__, transitions.core.State.__init__

Beginning fromwhich, 22 functions are then indirectly called, including 16 transitions's internal APIs and 6 outsider APIs as follows:

[/xeonqq/co-pilot]
+--transitions.core.Machine.__init__
|      +--collections.deque
|      +--collections.OrderedDict
|      +--transitions.core.Machine.add_states
|      |      +--transitions.core.listify
|      |      +--transitions.core.Machine._create_state
|      |      +--transitions.core.Machine._add_model_to_state
|      |      |      +--functools.partial
|      |      |      +--transitions.core.Machine._checked_assignment
|      |      |      +--inspect.ismethod
|      |      +--collections.OrderedDict.keys
|      |      +--transitions.core.Machine.add_transition
|      |      |      +--transitions.core.Machine._create_event
|      |      |      +--transitions.core.Machine._add_trigger_to_model
|      |      |      |      +--transitions.core.Machine._checked_assignment
|      |      |      |      +--functools.partial
|      |      |      +--collections.OrderedDict.keys
|      |      |      +--transitions.core.listify
|      |      |      +--transitions.core.Machine._has_state
|      |      |      |      +--collections.OrderedDict.values
|      |      |      +--transitions.core.Machine._create_transition
|      |      +--functools.partial
|      +--transitions.core.Machine.add_transitions
|      |      +--transitions.core.listify
|      |      +--transitions.core.Machine.add_transition
|      +--transitions.core.Machine.add_ordered_transitions
|      |      +--collections.OrderedDict.keys
|      |      +--transitions.core._prep_ordered_arg
|      |      |      +--transitions.core.listify
|      |      +--transitions.core.Machine.add_transition
|      +--transitions.core.Machine.add_model
|      |      +--transitions.core.listify
|      |      +--transitions.core.Machine._checked_assignment
|      |      +--collections.OrderedDict.values
|      |      +--transitions.core.Machine.set_state
|      |      |      +--transitions.core.Machine.get_state
|      |      |      +--transitions.core.listify
|      |      +--functools.partial
|      |      +--transitions.core.Machine._add_trigger_to_model
|      |      +--transitions.core.Machine._add_model_to_state
+--transitions.core.State.__init__
|      +--transitions.core.listify

Since all these functions have not been changed between any version for package "transitions" from [0.8.11] and 0.8.10. Therefore, we believe it is safe to loosen the corresponding dependency.

RPi 4 issues

Hi!

Love the project! My new gf keeps not seeing traffic lights and was SO EXCITED to find this! Wanted to make it a gift but I'm stuck after playing with it for over 2 weeks. Just can't get it running.

I'm using a RPi4 4GB on 32bit Raspbian, current release.
Running in X as I thought perhaps it was needed to use the camera.
I had tried headless via SSH with the same issues.
Using an 8MP picam on the port by the pins.
I've tried Python 3.9 fully updated including pip and 3.7 without updating pip.

I'm unclear if the camera needs to be enabled as legacy in boot.cfg or not? I've tried the python setup as well, but co-pilot doesn't see the camera then. Either way I get good quality stills and video preview.

I don't have the Corel Accelerator, so added --cpu in cmd and the task manager

Also, don't have a button or LED so I disabled the LED function and removed all but the first "full" co-pilot options in task manager and set the index from -1 to 0.

I have solved a number of issues but now I'm stuck with the below errors.

Thank you for this awesome project and any assistance!

Trying with Python 3.9:

copilot@raspberrypi:~/co-pilot $ sudo python3 -m src.main --ssd_model models/ssd_mobilenet_v2_coco_quant_no_nms_edgetpu.tflite --label models/coco_labels.txt --score_threshold 0.3 --traffic_lig>
/usr/lib/python3/dist-packages/picamera/encoders.py:519: PiCameraAlphaStripping: using alpha-stripping to convert to non-alpha format; you may find the equivalent alpha format faster
warnings.warn(
Exception in thread Thread-4:
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "/usr/lib/python3.9/threading.py", line 892, in run
self._target(*self._args, **self._kwargs)
File "/home/copilot/co-pilot/src/camera_capturer.py", line 32, in _run
self._camera.capture(
File "/usr/lib/python3/dist-packages/picamera/camera.py", line 1409, in capture
camera_port, output_port = self._get_ports(use_video_port, splitter_port)
File "/usr/lib/python3/dist-packages/picamera/camera.py", line 559, in _get_ports
self._check_camera_open()
File "/usr/lib/python3/dist-packages/picamera/camera.py", line 540, in _check_camera_open
raise PiCameraClosed("Camera is closed")
picamera.exc.PiCameraClosed: Camera is closed
Encountered unresolved custom op: edgetpu-custom-op.Node number 0 (edgetpu-custom-op) failed to prepare.

^CException ignored in: <module 'threading' from '/usr/lib/python3.9/threading.py'>
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 1428, in _shutdown
lock.acquire()
KeyboardInterrupt:
copilot@raspberrypi:~/co-pilot $ Output file #0 does not contain any stream

Trying with Python 3.7:
sudo python3.7 -m src.main --ssd_model models/ssd_mobilenet_v2_coco_quant_no_nms_edgetpu.tflite --label models/coco_labels.txt --score_threshold 0.3 --traffic_light_classification_model models/>
File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/copilot/co-pilot/src/main.py", line 10, in
from .led import Led
File "/home/copilot/co-pilot/src/led.py", line 1, in
import RPi.GPIO as GPIO
ModuleNotFoundError: No module named 'RPi'

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.