Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
food-round2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joel Joseph
food-round2
Commits
d6b69bda
Commit
d6b69bda
authored
6 years ago
by
yhcao6
Browse files
Options
Downloads
Patches
Plain Diff
add RepeatDataset
parent
a6ee0532
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mmdet/datasets/__init__.py
+2
-1
2 additions, 1 deletion
mmdet/datasets/__init__.py
mmdet/datasets/repeat_dataset.py
+18
-0
18 additions, 0 deletions
mmdet/datasets/repeat_dataset.py
with
20 additions
and
1 deletion
mmdet/datasets/__init__.py
+
2
−
1
View file @
d6b69bda
...
@@ -3,9 +3,10 @@ from .coco import CocoDataset
...
@@ -3,9 +3,10 @@ from .coco import CocoDataset
from
.loader
import
GroupSampler
,
DistributedGroupSampler
,
build_dataloader
from
.loader
import
GroupSampler
,
DistributedGroupSampler
,
build_dataloader
from
.utils
import
to_tensor
,
random_scale
,
show_ann
,
get_dataset
from
.utils
import
to_tensor
,
random_scale
,
show_ann
,
get_dataset
from
.concat_dataset
import
ConcatDataset
from
.concat_dataset
import
ConcatDataset
from
.repeat_dataset
import
RepeatDataset
__all__
=
[
__all__
=
[
'
CustomDataset
'
,
'
CocoDataset
'
,
'
GroupSampler
'
,
'
DistributedGroupSampler
'
,
'
CustomDataset
'
,
'
CocoDataset
'
,
'
GroupSampler
'
,
'
DistributedGroupSampler
'
,
'
ConcatDataset
'
,
'
build_dataloader
'
,
'
to_tensor
'
,
'
random_scale
'
,
'
ConcatDataset
'
,
'
build_dataloader
'
,
'
to_tensor
'
,
'
random_scale
'
,
'
show_ann
'
,
'
get_dataset
'
'
show_ann
'
,
'
get_dataset
'
,
'
RepeatDataset
'
]
]
This diff is collapsed.
Click to expand it.
mmdet/datasets/repeat_dataset.py
0 → 100644
+
18
−
0
View file @
d6b69bda
import
numpy
as
np
class
RepeatDataset
(
object
):
def
__init__
(
self
,
dataset
,
repeat_times
):
self
.
dataset
=
dataset
self
.
repeat_times
=
repeat_times
if
hasattr
(
self
.
dataset
,
'
flag
'
):
self
.
flag
=
np
.
tile
(
self
.
dataset
.
flag
,
repeat_times
)
self
.
length
=
len
(
self
.
dataset
)
*
self
.
repeat_times
def
__getitem__
(
self
,
idx
):
return
self
.
dataset
[
idx
%
len
(
self
.
dataset
)]
def
__len__
(
self
):
return
self
.
length
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment