Spaces:
Runtime error
Runtime error
Commit ·
a63e231
1
Parent(s): 738002f
New Default Config
Browse files- InferenceConfig.py +16 -12
- app.py +2 -0
InferenceConfig.py
CHANGED
|
@@ -1,22 +1,23 @@
|
|
| 1 |
from enum import Enum
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
### Configuration options
|
| 4 |
WEIGHTS = 'models/v5m_896_300best.pt'
|
| 5 |
# will need to configure these based on GPU hardware
|
| 6 |
BATCH_SIZE = 32
|
| 7 |
|
| 8 |
CONF_THRES = 0.05 # detection
|
| 9 |
-
NMS_IOU = 0.
|
| 10 |
-
MAX_AGE =
|
| 11 |
-
MIN_HITS =
|
| 12 |
MIN_LENGTH = 0.3 # minimum fish length, in meters
|
| 13 |
IOU_THRES = 0.01 # IOU threshold for tracking
|
| 14 |
MIN_TRAVEL = -1 # Minimum distance a track has to travel
|
| 15 |
-
|
| 16 |
-
class TrackerType(Enum):
|
| 17 |
-
NONE = 0
|
| 18 |
-
CONF_BOOST = 1
|
| 19 |
-
BYTETRACK = 2
|
| 20 |
|
| 21 |
class InferenceConfig:
|
| 22 |
def __init__(self,
|
|
@@ -30,11 +31,14 @@ class InferenceConfig:
|
|
| 30 |
self.min_length = min_length
|
| 31 |
self.min_travel = min_travel
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
self.associative_tracker = TrackerType.NONE
|
| 34 |
-
self.boost_power = 1
|
| 35 |
-
self.boost_decay = 1
|
| 36 |
-
self.byte_low_conf = 1
|
| 37 |
-
self.byte_high_conf = 1
|
| 38 |
|
| 39 |
def enable_conf_boost(self, power, decay):
|
| 40 |
self.associative_tracker = TrackerType.CONF_BOOST
|
|
|
|
| 1 |
from enum import Enum
|
| 2 |
|
| 3 |
+
class TrackerType(Enum):
|
| 4 |
+
NONE = 0
|
| 5 |
+
CONF_BOOST = 1
|
| 6 |
+
BYTETRACK = 2
|
| 7 |
+
|
| 8 |
### Configuration options
|
| 9 |
WEIGHTS = 'models/v5m_896_300best.pt'
|
| 10 |
# will need to configure these based on GPU hardware
|
| 11 |
BATCH_SIZE = 32
|
| 12 |
|
| 13 |
CONF_THRES = 0.05 # detection
|
| 14 |
+
NMS_IOU = 0.25 # NMS IOU
|
| 15 |
+
MAX_AGE = 20 # time until missing fish get's new id
|
| 16 |
+
MIN_HITS = 11 # minimum number of frames with a specific fish for it to count
|
| 17 |
MIN_LENGTH = 0.3 # minimum fish length, in meters
|
| 18 |
IOU_THRES = 0.01 # IOU threshold for tracking
|
| 19 |
MIN_TRAVEL = -1 # Minimum distance a track has to travel
|
| 20 |
+
DEFAULT_TRACKER = TrackerType.BYTETRACK
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
class InferenceConfig:
|
| 23 |
def __init__(self,
|
|
|
|
| 31 |
self.min_length = min_length
|
| 32 |
self.min_travel = min_travel
|
| 33 |
|
| 34 |
+
self.associative_tracker = DEFAULT_TRACKER
|
| 35 |
+
self.boost_power = 2
|
| 36 |
+
self.boost_decay = 0.1
|
| 37 |
+
self.byte_low_conf = 0.1
|
| 38 |
+
self.byte_high_conf = 0.3
|
| 39 |
+
|
| 40 |
+
def enable_sort_track(self):
|
| 41 |
self.associative_tracker = TrackerType.NONE
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
def enable_conf_boost(self, power, decay):
|
| 44 |
self.associative_tracker = TrackerType.CONF_BOOST
|
app.py
CHANGED
|
@@ -56,6 +56,8 @@ def on_aris_input(file_list, model_id, conf_thresh, iou_thresh, min_hits, max_ag
|
|
| 56 |
state['config'].enable_conf_boost(boost_power, boost_decay)
|
| 57 |
elif (associative_tracker == "ByteTrack"):
|
| 58 |
state['config'].enable_byte_track(byte_low_conf, byte_high_conf)
|
|
|
|
|
|
|
| 59 |
|
| 60 |
print(" ")
|
| 61 |
print("Running with:")
|
|
|
|
| 56 |
state['config'].enable_conf_boost(boost_power, boost_decay)
|
| 57 |
elif (associative_tracker == "ByteTrack"):
|
| 58 |
state['config'].enable_byte_track(byte_low_conf, byte_high_conf)
|
| 59 |
+
else:
|
| 60 |
+
state['config'].enable_sort_track()
|
| 61 |
|
| 62 |
print(" ")
|
| 63 |
print("Running with:")
|