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

i want detect juset 1frames in 6frames in video #8079

Closed
1 task done
LimJihu opened this issue Jun 2, 2022 · 4 comments
Closed
1 task done

i want detect juset 1frames in 6frames in video #8079

LimJihu opened this issue Jun 2, 2022 · 4 comments
Labels
question Further information is requested Stale Stale and schedule for closing soon

Comments

@LimJihu
Copy link

LimJihu commented Jun 2, 2022

Search before asking

Question

hello.

i want to detect 1frames per 6frames. so, if my video have 12000frames in video, i just detect 2000frames only.

so i wrote my code like
image
(this is detect.py)

but the result is
image

i have no idea about this.. i just returned 1 framed-video ( the output video have just one frame)

can anybody help me?

Additional

No response

@LimJihu LimJihu added the question Further information is requested label Jun 2, 2022
@glenn-jocher
Copy link
Member

@LimJihu you can skip frames in the video dataloader here:

yolov5/utils/dataloaders.py

Lines 216 to 228 in 7cef03d

if self.video_flag[self.count]:
# Read video
self.mode = 'video'
ret_val, img0 = self.cap.read()
while not ret_val:
self.count += 1
self.cap.release()
if self.count == self.nf: # last video
raise StopIteration
path = self.files[self.count]
self.new_video(path)
ret_val, img0 = self.cap.read()

@LimJihu
Copy link
Author

LimJihu commented Jun 3, 2022

@glenn-jocher
thanks a lot, but i don't know how to operate this code.
i want detect 2000frames and left (not delete) 10000frames left.
my goal is detect 1 frame in every 6frames, and track left 5frames in every 6 frames.

any help?

@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2022

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 🚀 resources:

Access additional Ultralytics ⚡ resources:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐!

@github-actions github-actions bot added the Stale Stale and schedule for closing soon label Jul 4, 2022
@glenn-jocher
Copy link
Member

@LimJihu I understand. You can achieve this by modifying the code in detect.py to skip frames in the video. You can use the frame index to determine when to skip frames. For example, you can modify your while loop to skip frames using the frame index. Additionally, for tracking the left frames, you can use a tracker like SORT or DeepSORT. For further assistance, you can refer to the Ultralytics Docs at https://docs.ultralytics.com/yolov5/ or ask for help in the YOLOv5 Discussions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Stale Stale and schedule for closing soon
Projects
None yet
Development

No branches or pull requests

2 participants