JeVoisBase
1.22
JeVois Smart Embedded Machine Vision Toolkit Base Modules
Share this page:
Tweet
Loading...
Searching...
No Matches
tracking.py
Go to the documentation of this file.
1
import
os
2
import
numpy
as
np
3
4
from
.base_dataloader
import
_BaseVideoLoader
5
from
..factory
import
DATALOADERS
6
7
@DATALOADERS.register
8
class
TrackingVideoLoader
(
_BaseVideoLoader
):
9
def
__init__
(self, **kwargs):
10
super().
__init__
(**kwargs)
11
12
self.
_first_frames
= dict()
13
for
filename
in
self.
_files
:
14
stream = self.
_streams
[filename]
15
self.
_first_frames
[filename] = next(stream)
16
17
self.
_rois
= self.
_load_roi
()
18
19
def
_load_roi
(self):
20
rois = dict.fromkeys(self.
_files
,
None
)
21
for
filename
in
self.
_files
:
22
rois[filename] = np.loadtxt(os.path.join(self.
_path
,
'{}.txt'
.format(filename[:-4])), dtype=np.int32, ndmin=2)
23
return
rois
24
25
def
__getitem__
(self, idx):
26
filename = self.
_files
[idx]
27
return
filename, self.
_streams
[filename], self.
_first_frames
[filename], self.
_rois
[filename]
utils.dataloaders.base_dataloader._BaseVideoLoader
Definition
base_dataloader.py:64
utils.dataloaders.base_dataloader._BaseVideoLoader._streams
_streams
Definition
base_dataloader.py:72
utils.dataloaders.base_dataloader._BaseVideoLoader._files
_files
Definition
base_dataloader.py:69
utils.dataloaders.base_dataloader._BaseVideoLoader._path
_path
Definition
base_dataloader.py:66
utils.dataloaders.tracking.TrackingVideoLoader
Definition
tracking.py:8
utils.dataloaders.tracking.TrackingVideoLoader.__init__
__init__(self, **kwargs)
Definition
tracking.py:9
utils.dataloaders.tracking.TrackingVideoLoader._rois
_rois
Definition
tracking.py:17
utils.dataloaders.tracking.TrackingVideoLoader._first_frames
_first_frames
Definition
tracking.py:12
utils.dataloaders.tracking.TrackingVideoLoader._load_roi
_load_roi(self)
Definition
tracking.py:19
utils.dataloaders.tracking.TrackingVideoLoader.__getitem__
__getitem__(self, idx)
Definition
tracking.py:25
opencv_zoo
benchmark
utils
dataloaders
tracking.py
Please help us improve this page: Edit it on
GitHub
or
email us your edits and suggestions.
Generated by
1.9.8