-
Notifications
You must be signed in to change notification settings - Fork 191
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
Object_Detection: NanoDet (GSOC) #87
Closed
Closed
Conversation
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
Added Video input inference
- class name change - built-in function changes
This PR is for NanoDet, so please remove the |
removed yolox directory |
fengyuentau
reviewed
Sep 4, 2022
removing coco.names file
- updated changes
resolved changes, no limit on capture "cv2.waitKey(1) < 0" [Line 138]
Yes, resolving the changes
…On Sun, Sep 4, 2022 at 7:38 AM Yuantao Feng ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In models/object_detection_nanodet/NanodetPlus.py
<#87 (comment)>:
> + with open('coco.names', 'rt') as f:
+ self.classes = f.read().rstrip('\n').split('\n')
Lets keep all classes here in this file like this
<https://github.com/open-mmlab/mmdetection/blob/df28da98926bc410e16bed1e9fc7d425d9a89495/mmdet/datasets/coco.py#L25-L38>
------------------------------
In models/object_detection_nanodet/NanodetPlus.py
<#87 (comment)>:
> + top, left, newh, neww = 0, 0, self.image_shape[0], self.image_shape[1]
+ if keep_ratio and srcimg.shape[0] != srcimg.shape[1]:
+ hw_scale = srcimg.shape[0] / srcimg.shape[1]
+ if hw_scale > 1:
+ newh, neww = self.image_shape[0], int(self.image_shape[1] / hw_scale)
+ img = cv2.resize(srcimg, (neww, newh), interpolation=cv2.INTER_AREA)
+ left = int((self.image_shape[1] - neww) * 0.5)
+ img = cv2.copyMakeBorder(img, 0, 0, left, self.image_shape[1] - neww - left, cv2.BORDER_CONSTANT,
+ value=0) # add border
+ else:
+ newh, neww = int(self.image_shape[0] * hw_scale), self.image_shape[1]
+ img = cv2.resize(srcimg, (neww, newh), interpolation=cv2.INTER_AREA)
+ top = int((self.image_shape[0] - newh) * 0.5)
+ img = cv2.copyMakeBorder(img, top, self.image_shape[0] - newh - top, 0, 0, cv2.BORDER_CONSTANT, value=0)
+ else:
+ img = cv2.resize(srcimg, self.image_shape, interpolation=cv2.INTER_AREA)
+
+ blob = self.pre_process(img)
Can we reuse the code from yolox for letterbox preprocessing?
------------------------------
In models/object_detection_nanodet/NanodetPlus.py
<#87 (comment)>:
> + value=0) # add border
+ else:
+ newh, neww = int(self.image_shape[0] * hw_scale), self.image_shape[1]
+ img = cv2.resize(srcimg, (neww, newh), interpolation=cv2.INTER_AREA)
+ top = int((self.image_shape[0] - newh) * 0.5)
+ img = cv2.copyMakeBorder(img, top, self.image_shape[0] - newh - top, 0, 0, cv2.BORDER_CONSTANT, value=0)
+ else:
+ img = cv2.resize(srcimg, self.image_shape, interpolation=cv2.INTER_AREA)
+
+ blob = self.pre_process(img)
+ self.net.setInput(blob)
+ outs = self.net.forward(self.net.getUnconnectedOutLayersNames())
+ det_bboxes, det_conf, det_classid = self.post_process(outs)
+ ratioh,ratiow = srcimg.shape[0]/newh,srcimg.shape[1]/neww
+
+ return left, top, ratioh, ratiow, det_bboxes, det_conf, det_classid
I propose to have the same formatting of results of yolox.
------------------------------
In models/object_detection_nanodet/coco.names
<#87 (comment)>:
> @@ -0,0 +1,80 @@
+person
This file is not needed if we keep these classes in the wrapper class.
------------------------------
In models/object_detection_nanodet/demo.py
<#87 (comment)>:
> + if(Video_save):
+ clip = moviepy.video.io.ImageSequenceClip.ImageSequenceClip(frame_list, fps=fps)
+ clip.write_videofile('Webcam_result.mp4')
Use VideoWriter instead.
—
Reply to this email directly, view it on GitHub
<#87 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALTC7V6AFWSL5FZ72IKDEKDV4QAANANCNFSM57AGTIAA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@Sidd1609 could you squash commits into one? I am going to work on this pr and merge it. |
Changes have been made for nanodet
And yolox commits have been updated in separate branch
…On Fri, Oct 21, 2022 at 12:37 PM Yuantao Feng ***@***.***> wrote:
@Sidd1609 <https://github.com/Sidd1609> could you squash commits into
one? I am going to work on this pr and merge it.
—
Reply to this email directly, view it on GitHub
<#87 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALTC7V3SWF7K6DDP2F5W6OTWEI6MHANCNFSM57AGTIAA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
close in favor of #103 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updated files for object detection using YOLOX,
files uploaded for review:
COMPLETED:
TO DO: