Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deepstream 5.1 python ssd mobilenet x86 #11

Merged
merged 19 commits into from May 28, 2021

Conversation

undefined-references
Copy link
Contributor

Improvements:

  • Moved previous version to deepstream/5.0
  • Placed this new version to deepstream/5.1
  • Added dockerfile and script for this version

Please don't merge until I push modifications to documents.

Copy link
Contributor

@alpha-carinae29 alpha-carinae29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @undefined-references. it is a great feature.
I just left some comments :)

cd ssd_mobilenet_v2 && mkdir -p 1
cp /repo/deepstream-data/frozen_inference_graph.pb 1/model.graphdef

label_file_path="/repo/deepstream/5.1/ssd_mobilenet_v2/labels.txt"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Adaptive Learning API return a label_map.pbtxt, I would get label_map.pbtxt from user and parse and save it to required format.
for parsing this file you can use these modules:
https://github.com/neuralet/adaptive-object-detection/blob/main/utils/parse_label_map.py
https://github.com/neuralet/adaptive-object-detection/blob/main/protos/label_map_pb2.py

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

fi

cd ..
python3 deepstream_ssd_parser.py $videoPath $label_file_path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if you get an output_directory argument and save the output video in this directory

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

fi

videoPath="file://$videoPath"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add another argument which takes the frozen_inference_graph.pb path from user. if the user doesn't provide a file we can download default COCO model from TensorFlow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added. Thanks

MIN_BOX_HEIGHT = 32
TOP_K = 20
IOU_THRESHOLD = 0.3
OUTPUT_VIDEO_NAME = "./out.mp4"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on provided output_directory and the file name you can create an unique address for the output video path:
for example if the user provides /home/deepstream_output/ as the output directory and the input video file is softbio.mp4 the OUTPUT_VIDEO_NAME will be /home/deepstream_output/softbio_neuralet_deepstream.mp4

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

MIN_BOX_WIDTH, MIN_BOX_HEIGHT)
nms_param = NmsParam(TOP_K, IOU_THRESHOLD)

label_names = get_label_names_from_file("ssd_mobilenet_v2/labels.txt")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use hard coded path. Put the input argument instead even if this is a constant address.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified, thanks.

# allocated string. Use pyds.get_string() to get the string content.
id_dict = {
val: index
for index, val in enumerate(get_label_names_from_file("ssd_mobilenet_v2/labels.txt"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use hard coded path. Put the input argument instead even if this is a constant address.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@mhejrati mhejrati merged commit 9022c5a into galliot-us:main May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants