discopat package
Subpackages
- discopat.cdl package
- discopat.core package
- Subpackages
- discopat.core.entities package
- Submodules
- discopat.core.entities.annotation module
- discopat.core.entities.array module
- discopat.core.entities.data module
- discopat.core.entities.detection module
- discopat.core.entities.frame module
- discopat.core.entities.metadata module
- discopat.core.entities.movie module
- discopat.core.entities.tracking module
- Module contents
- discopat.core.entities package
- Submodules
- discopat.core.value_objects module
- Module contents
- Subpackages
- discopat.datasets package
- discopat.manual_annotations package
- discopat.metrics package
- discopat.nn_models package
- discopat.nn_training package
- Subpackages
- Submodules
- discopat.nn_training.nn_trainer module
- discopat.nn_training.torch module
- discopat.nn_training.utils module
- Module contents
- discopat.repositories package
Submodules
discopat.basics module
- discopat.basics.gs_to_rgb(array, channel_mode='channels_last')[source]
- Parameters:
array (ndarray)
channel_mode (str)
- Return type:
ndarray
discopat.disco module
discopat.display module
- discopat.display.frame_to_pil(frame, tracks, max_track_length=0, persistence=10, cmap='gray', track_color='red')[source]
Make a PIL image from a frame.
- Parameters:
frame (Frame)
tracks (np.array)
max_track_length (int)
persistence (int)
cmap (str)
track_color (str)
- Return type:
Image
- discopat.display.get_center_path(track)[source]
Get the trajectory of the center of the boxes corresponding to one track.
- Parameters:
track (array) – Array of shape (num_frames, 5) where each line corresponds to a box: - track[:, 0] = id of the frame, - track[:, 1] = xmin, - track[:, 2] = ymin, - track[:, 3] = xmax, - track[:, 4] = ymax.
- Returns:
Array of shape (num_frame, 2), where each line corresponds to the (x, y) coordinates of the center of the box.
- Return type:
array
- discopat.display.make_movie(movie, persistence, cmap, track_color, fps, output_format)[source]
- Parameters:
movie (Movie)
persistence (int)
cmap (str)
track_color (str)
fps (int)
output_format (str)
- discopat.display.plot_annotation(ax, annotation, color)[source]
- Parameters:
ax (Axes)
annotation (Annotation)
color (str)
- discopat.display.plot_frame(frame, cmap='gray', annotation_color='tab:red', show_figure=True, return_figure=False, figure_size=None, figure_dpi=None)[source]
- Parameters:
frame (Frame)
cmap (str)
annotation_color (str)
show_figure (bool)
return_figure (bool)
figure_size (tuple[float, float] or None)
figure_dpi (int or None)
discopat.tokam module
- discopat.tokam.collate_fn(batch)[source]
Collate function to make dataloaders.
- Parameters:
batch (Tensor)
- Return type:
tuple
discopat.tracking module
SORT: A Simple, Online and Realtime Tracker.
Copyright (C) 2016-2020 Alex Bewley alex@bewley.ai
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
- class discopat.tracking.KalmanBoxTracker(bbox)[source]
Bases:
objectThis class represents the internal state of individual tracked objects observed as bbox.
- count = 0
- class discopat.tracking.Sort(max_age=1, min_hits=3, iou_threshold=0.3)[source]
Bases:
object- update(dets=array([], shape=(0, 5), dtype=float64))[source]
- Params:
dets - a numpy array of detections in the format [[x1,y1,x2,y2,score],[x1,y1,x2,y2,score],…]
Requires: this method must be called once for each frame even with empty detections (use np.empty((0, 5)) for frames without detections). Returns the a similar array, where the last column is the object ID.
NOTE: The number of objects returned may differ from the number of detections provided.
- discopat.tracking.associate_detections_to_trackers(detections, trackers, iou_threshold=0.3)[source]
Assign detections to tracked object (both represented as bounding boxes).
Returns 3 lists of matches, unmatched_detections and unmatched_trackers
- discopat.tracking.convert_bbox_to_z(bbox)[source]
- Takes a bounding box in the form [x1,y1,x2,y2] and returns z in the form
[x,y,s,r] where x,y is the centre of the box and s is the scale/area and r is the aspect ratio
- discopat.tracking.convert_x_to_bbox(x, score=None)[source]
- Takes a bounding box in the centre form [x,y,s,r] and returns it in the form
[x1,y1,x2,y2] where x1,y1 is the top left and x2,y2 is the bottom right