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

Updated detect.py to save images in images/ directory when save_txt is True #12914

Open
wants to merge 57 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
1eee3e5
updated detect.py to save images in images/ directory when save_txt i…
harshdhamecha Apr 13, 2024
c955007
Merge branch 'master' into exp
UltralyticsAssistant Apr 14, 2024
e330d4e
Merge branch 'master' into exp
UltralyticsAssistant Apr 18, 2024
f34e0a5
Merge branch 'master' into exp
UltralyticsAssistant Apr 27, 2024
67efcb6
Merge branch 'master' into exp
UltralyticsAssistant Apr 28, 2024
ad6b858
Auto-format by https://ultralytics.com/actions
UltralyticsAssistant Apr 28, 2024
a553956
Merge branch 'master' into exp
UltralyticsAssistant May 5, 2024
6628b6b
Merge branch 'master' into exp
UltralyticsAssistant May 12, 2024
6c83034
Merge branch 'master' into exp
UltralyticsAssistant May 12, 2024
3576664
Merge branch 'master' into exp
UltralyticsAssistant May 12, 2024
e60abb4
Merge branch 'master' into exp
UltralyticsAssistant May 12, 2024
ce7dc87
Merge branch 'master' into exp
UltralyticsAssistant May 13, 2024
72ba526
Merge branch 'master' into exp
UltralyticsAssistant May 18, 2024
ee78156
Merge branch 'master' into exp
UltralyticsAssistant May 24, 2024
cfdf352
Merge branch 'master' into exp
UltralyticsAssistant May 28, 2024
0fe4470
Merge branch 'master' into exp
UltralyticsAssistant May 29, 2024
97da60e
Merge branch 'master' into exp
UltralyticsAssistant May 29, 2024
6ed83a3
Merge branch 'master' into exp
UltralyticsAssistant May 30, 2024
dc3fab7
Merge branch 'master' into exp
UltralyticsAssistant Jun 8, 2024
72ef71d
Merge branch 'master' into exp
UltralyticsAssistant Jun 8, 2024
e1ac8bf
Merge branch 'master' into exp
UltralyticsAssistant Jun 9, 2024
763ec7b
Merge branch 'master' into exp
UltralyticsAssistant Jun 16, 2024
7c0accc
Merge branch 'master' into exp
UltralyticsAssistant Jun 16, 2024
241db01
Merge branch 'master' into exp
UltralyticsAssistant Jun 17, 2024
bc3eecf
Merge branch 'master' into exp
UltralyticsAssistant Jun 19, 2024
7bb7b09
Merge branch 'master' into exp
UltralyticsAssistant Jun 19, 2024
e997060
Merge branch 'master' into exp
UltralyticsAssistant Jun 20, 2024
131593b
Merge branch 'master' into exp
UltralyticsAssistant Jun 20, 2024
7fa7797
Merge branch 'master' into exp
UltralyticsAssistant Jun 20, 2024
8f5dca7
Merge branch 'master' into exp
UltralyticsAssistant Jun 20, 2024
b95311f
Merge branch 'master' into exp
UltralyticsAssistant Jun 22, 2024
e0bd83b
Merge branch 'master' into exp
UltralyticsAssistant Jun 30, 2024
1ca999e
Merge branch 'master' into exp
UltralyticsAssistant Jun 30, 2024
4bf0204
Merge branch 'master' into exp
UltralyticsAssistant Jun 30, 2024
978adc7
Merge branch 'master' into exp
UltralyticsAssistant Jul 5, 2024
8e717f6
Merge branch 'master' into exp
UltralyticsAssistant Jul 8, 2024
0be9f0d
Merge branch 'master' into exp
UltralyticsAssistant Jul 8, 2024
b3664f9
Merge branch 'master' into exp
UltralyticsAssistant Jul 8, 2024
3e0cf23
Merge branch 'master' into exp
UltralyticsAssistant Jul 10, 2024
ee7c925
Merge branch 'master' into exp
UltralyticsAssistant Jul 13, 2024
896b8b1
Merge branch 'master' into exp
UltralyticsAssistant Jul 15, 2024
02261d9
Merge branch 'master' into exp
UltralyticsAssistant Jul 15, 2024
8b89ff4
Merge branch 'master' into exp
UltralyticsAssistant Jul 17, 2024
a5bb756
Merge branch 'master' into exp
UltralyticsAssistant Jul 17, 2024
e0622c8
Merge branch 'master' into exp
UltralyticsAssistant Jul 22, 2024
9c3ee6d
Merge branch 'master' into exp
UltralyticsAssistant Jul 23, 2024
49e5a2b
Merge branch 'master' into exp
UltralyticsAssistant Jul 25, 2024
f42af27
Merge branch 'master' into exp
UltralyticsAssistant Jul 29, 2024
a063108
Merge branch 'master' into exp
UltralyticsAssistant Jul 29, 2024
7da4888
Merge branch 'master' into exp
UltralyticsAssistant Aug 11, 2024
1571018
Merge branch 'master' into exp
UltralyticsAssistant Aug 14, 2024
17f019d
Merge branch 'master' into exp
UltralyticsAssistant Aug 14, 2024
13bd845
Merge branch 'master' into exp
UltralyticsAssistant Aug 19, 2024
42a5bcd
Merge branch 'master' into exp
UltralyticsAssistant Aug 20, 2024
bfba659
Merge branch 'master' into exp
UltralyticsAssistant Aug 20, 2024
cb0baea
Merge branch 'master' into exp
UltralyticsAssistant Aug 24, 2024
d0d9281
Auto-format by https://ultralytics.com/actions
UltralyticsAssistant Aug 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ def run(

# Directories
save_dir = increment_path(Path(project) / name, exist_ok=exist_ok) # increment run
(save_dir / "images").mkdir(parents=True, exist_ok=True) if save_txt else None
img_save_path = save_dir / "images" if save_txt else save_dir
# Images and lables will be saved in different directories if save_txt is true
(save_dir / "labels" if save_txt else save_dir).mkdir(parents=True, exist_ok=True) # make dir

# Load model
Expand Down Expand Up @@ -184,7 +187,7 @@ def write_to_csv(image_name, prediction, confidence):
p, im0, frame = path, im0s.copy(), getattr(dataset, "frame", 0)

p = Path(p) # to Path
save_path = str(save_dir / p.name) # im.jpg
save_path = str(img_save_path / p.name) # im.jpg
txt_path = str(save_dir / "labels" / p.stem) + ("" if dataset.mode == "image" else f"_{frame}") # im.txt
s += "%gx%g " % im.shape[2:] # print string
gn = torch.tensor(im0.shape)[[1, 0, 1, 0]] # normalization gain whwh
Expand Down
Loading