This file contains hidden or 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
| #!/bin/bash | |
| HOSTS=("8.8.8.8" "1.1.1.1") | |
| LOGFILE="ping_stats.csv" | |
| echo "timestamp,host,latency_ms" >> $LOGFILE | |
| while true; do | |
| TIMESTAMP=$(date "+%Y-%m-%d %H:%M:%S") | |
| for HOST in "${HOSTS[@]}"; do |
This file contains hidden or 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
| tracker.skip_epochs(2); | |
| let tracks = tracker.wasted(); | |
| for t in tracks { | |
| eprintln!("Track id: {}", t.get_track_id()); | |
| eprintln!("Boxes: {:#?}", t.get_attributes().predicted_boxes); | |
| } |
This file contains hidden or 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
| #[derive(Debug, Copy, Clone)] | |
| pub struct SortTrack { | |
| pub id: u64, | |
| pub epoch: usize, | |
| pub predicted_bbox: BBox, | |
| pub observed_bbox: BBox, | |
| pub scene_id: u64, | |
| pub length: usize, | |
| } |
This file contains hidden or 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
| for _ in 0..10 { | |
| let obj1b = b1.next().unwrap(); | |
| let obj2b = b2.next().unwrap(); | |
| let _tracks = tracker.epoch(&[obj1b, obj2b]); | |
| //eprintln!("Tracked objects: {:#?}", _tracks); | |
| } |
This file contains hidden or 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
| impl SimpleSort { | |
| pub fn new(shards: usize, bbox_history: usize, max_idle_epochs: usize, threshold: f32) -> Self { | |
| ... | |
| } | |
| ... | |
| } |
This file contains hidden or 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
| use similari::examples::BoxGen2; | |
| use similari::trackers::sort::simple::SimpleSort; | |
| use similari::trackers::sort::DEFAULT_SORT_IOU_THRESHOLD; | |
| fn main() { | |
| let mut tracker = SimpleSort::new(1, 10, 1, DEFAULT_SORT_IOU_THRESHOLD); | |
| let pos_drift = 1.0; | |
| let box_drift = 0.2; | |
| let mut b1 = BoxGen2::new_monotonous(100.0, 100.0, 10.0, 15.0, pos_drift, box_drift); |
This file contains hidden or 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
| if __name__ == '__main__': | |
| # all train | |
| def bench(n): | |
| dets = [] | |
| for i in range(n): | |
| dets.append([1000 * i, 1000 * i, 1000 * i + 50, 1000 * i + 50]) | |
| dets = np.asarray(dets) | |
| mot_tracker = Sort(max_age=10, | |
| min_hits=3, |
This file contains hidden or 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
| from filterpy.kalman import KalmanFilter | |
| import numpy as np | |
| import time | |
| f = KalmanFilter (dim_x=2, dim_z=1) | |
| f.x = np.array([[2.], # position | |
| [0.]]) # velocity |
This file contains hidden or 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
| let (dists, errs) = store.foreign_track_distances(vec![search_track], FEAT0, false); | |
| assert!(errs.is_empty()); | |
| let winners = voting.winners(&dists); | |
| if winners.is_empty() { | |
| store.add_track(t).unwrap(); | |
| } else { | |
| store | |
| .merge_external( |
This file contains hidden or 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
| let (obj1f, obj1b) = (p1.next().unwrap(), b1.next().unwrap()); | |
| let track_id = u64::try_from(current_time_ms()).unwrap(); | |
| let mut obj1t = Track::new(track_id, None, None, None); | |
| obj1t | |
| .add_observation( | |
| FEAT0, | |
| obj1f.0, | |
| obj1f.1, | |
| Some(BBoxAttributesUpdate { bbox: obj1b }), |
NewerOlder