-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from rcland12/jetson_develop
Jetson develop
- Loading branch information
Showing
26 changed files
with
7,365 additions
and
513 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
*.m3u8 | ||
stream-*.ts | ||
tritonserver/ | ||
data/ | ||
triton2/ | ||
|
||
### Linux ### | ||
*~ | ||
|
This file was deleted.
Oops, something went wrong.
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,54 @@ | ||
import cv2 | ||
from nanocamera import Camera | ||
|
||
|
||
|
||
def main( | ||
save_path, | ||
number_to_save=100, | ||
period=5, | ||
camera_index=0, | ||
camera_width=1280, | ||
camera_height=720, | ||
camera_fps=30 | ||
): | ||
camera = Camera( | ||
device_id=camera_index, | ||
flip=0, | ||
width=camera_width, | ||
height=camera_height, | ||
fps=camera_fps | ||
) | ||
|
||
frame_index = 0 | ||
picture_index = 0 | ||
take_picture = camera_fps * period | ||
|
||
while camera.isReady(): | ||
frame = camera.read() | ||
|
||
if frame_index % take_picture: | ||
cv2.imwrite(save_path + f"pic_{picture_index}.png", frame) | ||
print(f"Saving image {picture_index}/{number_to_save}") | ||
picture_index += 1 | ||
|
||
if picture_index == number_to_save: | ||
break | ||
|
||
frame_index += 1 | ||
|
||
print(f"Saved {number_to_save} picture to `{save_path}` successfully.") | ||
return | ||
|
||
|
||
|
||
if __name__ == "__main__": | ||
main( | ||
save_path="../data/images/train/", | ||
number_to_save=100, | ||
period=5, | ||
camera_index=0, | ||
camera_width=1280, | ||
camera_height=720, | ||
camera_fps=30 | ||
) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.