-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Dataset and Support MMDET Training
- Loading branch information
Showing
17 changed files
with
294 additions
and
331 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from .eval_hooks import EvalHook, DistEvalHook | ||
from .mot import eval_mot | ||
|
||
__all__ = ['eval_mot'] | ||
__all__ = ['eval_mot', 'EvalHook', 'DistEvalHook'] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import os.path as osp | ||
|
||
from mmdet.core import DistEvalHook as _DistEvalHook | ||
from mmdet.core import EvalHook as _EvalHook | ||
|
||
|
||
class EvalHook(_EvalHook): | ||
|
||
def after_train_epoch(self, runner): | ||
if not self.evaluation_flag(runner): | ||
return | ||
from qdtrack.apis import single_gpu_test | ||
results = single_gpu_test(runner.model, self.dataloader, show=False) | ||
self.evaluate(runner, results) | ||
|
||
|
||
class DistEvalHook(_DistEvalHook): | ||
|
||
def after_train_epoch(self, runner): | ||
if not self.evaluation_flag(runner): | ||
return | ||
from qdtrack.apis import multi_gpu_test | ||
tmpdir = self.tmpdir | ||
if tmpdir is None: | ||
tmpdir = osp.join(runner.work_dir, '.eval_hook') | ||
results = multi_gpu_test( | ||
runner.model, | ||
self.dataloader, | ||
tmpdir=tmpdir, | ||
gpu_collect=self.gpu_collect) | ||
if runner.rank == 0: | ||
print('\n') | ||
self.evaluate(runner, results) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
from mmdet.datasets.builder import (DATASETS, PIPELINES, build_dataloader, | ||
build_dataset) | ||
from mmdet.datasets.builder import (DATASETS, PIPELINES, build_dataset) | ||
|
||
from .bdd_video_dataset import BDDVideoDataset | ||
from .builder import build_video_dataloader | ||
from .builder import build_dataloader | ||
from .coco_video_dataset import CocoVideoDataset | ||
from .parsers import CocoVID | ||
from .pipelines import (LoadMultiImagesFromFile, SeqCollect, | ||
SeqDefaultFormatBundle, SeqLoadAnnotations, | ||
SeqNormalize, SeqPad, SeqRandomFlip, SeqResize) | ||
|
||
__all__ = [ | ||
'DATASETS', 'PIPELINES', 'build_dataloader', 'build_video_dataloader', | ||
'build_dataset', 'CocoVID', 'BDDVideoDataset', 'CocoVideoDataset', | ||
'LoadMultiImagesFromFile', 'SeqLoadAnnotations', 'SeqResize', | ||
'SeqNormalize', 'SeqRandomFlip', 'SeqPad', 'SeqDefaultFormatBundle', | ||
'SeqCollect' | ||
'DATASETS', 'PIPELINES', 'build_dataloader', 'build_dataset', 'CocoVID', | ||
'BDDVideoDataset', 'CocoVideoDataset', 'LoadMultiImagesFromFile', | ||
'SeqLoadAnnotations', 'SeqResize', 'SeqNormalize', 'SeqRandomFlip', | ||
'SeqPad', 'SeqDefaultFormatBundle', 'SeqCollect' | ||
] |
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
Oops, something went wrong.