Skip to content

Added dexined quantized model for edge detection#272

Merged
fengyuentau merged 4 commits intoopencv:mainfrom
gursimarsingh:dexined_model
Sep 18, 2024
Merged

Added dexined quantized model for edge detection#272
fengyuentau merged 4 commits intoopencv:mainfrom
gursimarsingh:dexined_model

Conversation

@gursimarsingh
Copy link
Copy Markdown
Contributor

Added dexined quantized model for edge detection DNN sample.

@gursimarsingh gursimarsingh added the quantization Anything related to model quantization label Aug 29, 2024
@gursimarsingh gursimarsingh added this to the 5.0 milestone Aug 29, 2024
@asmorkalov asmorkalov requested a review from fengyuentau August 29, 2024 14:25
Copy link
Copy Markdown
Member

@fengyuentau fengyuentau left a comment

Choose a reason for hiding this comment

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

  1. License is required for every model in the zoo. Compatible licenses are Apache 2.0, MIT. Please refer to the original license.
  2. Add a readme and a link to the sample code in opencv/samples. Also add reference to the original source of the model.
  3. Follow the naming pattern. The filename of the model should be ${task}_${model_name}_${timestamp}.onnx, such as edge_detection_dexined_2024sep.onnx.

Comment thread models/edge_detection_dexined/edge_detection.py Outdated
Comment thread models/edge_detection_dexined/edge_detection.py Outdated
Comment thread models/edge_detection_dexined/edge_detection.cpp Outdated
# Forward pass through the model
out = self._model.forward()
result, _ = self.postProcessing(out, image.shape[:2])
t, _ = self._model.getPerfProfile()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No need to get profile data here. The benchmark script measures at the whole infer function.

We normally measure the time of the whole pipeline including preprocessing, inference and post processing. You can use TickMeter to do so, e.g.

tm = cv.TickMeter()
while cv.waitKey(1) < 0:
hasFrame, frame = cap.read()
if not hasFrame:
print('No frames grabbed!')
break
# Inference
tm.start()
results = model.infer(frame) # results is a tuple
tm.stop()
# Draw results on the input image
frame = visualize(frame, results, fps=tm.getFPS())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you rename the file to demo.cpp? Just want to keep aligned with others in this repo.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you rename the file to demo.py? Just want to keep aligned with others in this repo.

Copy link
Copy Markdown
Member

@fengyuentau fengyuentau left a comment

Choose a reason for hiding this comment

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

👍

@fengyuentau fengyuentau merged commit 50cc599 into opencv:main Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

quantization Anything related to model quantization

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants