-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor applications and added pipeline helper functions. * Added development guide. * Adding tests to rpi example and the tests runner * Adding install.sh file * Adding hailo8 support * pose h8 is set to yolov5s as default * Post processes are included in this repo * moved args to rpi_common * Added barcode video. All pipeline uses demo video as default input * Updated H8 hefs. Added support for uint16 for pose postprocess * updated doc for AI HAT. --------- Co-authored-by: OmAz-AI <[email protected]> Co-authored-by: OmriA <[email protected]> Co-authored-by: ronithailo <[email protected]>
- Loading branch information
1 parent
123e675
commit c19d4ba
Showing
31 changed files
with
2,162 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import os | ||
import subprocess | ||
|
||
# if udevadm is not installed, install it using the following command: | ||
# sudo apt-get install udev | ||
|
||
|
||
def get_usb_video_devices(): | ||
""" | ||
Get a list of video devices that are connected via USB and have video capture capability. | ||
""" | ||
video_devices = [f'/dev/{device}' for device in os.listdir('/dev') if device.startswith('video')] | ||
usb_video_devices = [] | ||
|
||
for device in video_devices: | ||
try: | ||
# Use udevadm to get detailed information about the device | ||
udevadm_cmd = ["udevadm", "info", "--query=all", "--name=" + device] | ||
result = subprocess.run(udevadm_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | ||
output = result.stdout.decode('utf-8') | ||
|
||
# Check if the device is connected via USB and has video capture capabilities | ||
if "ID_BUS=usb" in output and ":capture:" in output: | ||
usb_video_devices.append(device) | ||
except Exception as e: | ||
print(f"Error checking device {device}: {e}") | ||
|
||
return usb_video_devices | ||
|
||
if __name__ == "__main__": | ||
usb_video_devices = get_usb_video_devices() | ||
|
||
if usb_video_devices: | ||
print(f"USB cameras found on: {', '.join(usb_video_devices)}") | ||
else: | ||
print("No available USB cameras found.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.