xttmp 2.3.0.7__tar.gz → 2.3.0.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. {xttmp-2.3.0.7/src/xttmp.egg-info → xttmp-2.3.0.8}/PKG-INFO +1 -1
  2. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/pyproject.toml +1 -1
  3. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/core/math_operator.py +10 -15
  4. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/model/feedback_model.py +7 -11
  5. {xttmp-2.3.0.7 → xttmp-2.3.0.8/src/xttmp.egg-info}/PKG-INFO +1 -1
  6. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/LICENSE +0 -0
  7. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/README.md +0 -0
  8. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/setup.cfg +0 -0
  9. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/__init__.py +0 -0
  10. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/api/__init__.py +0 -0
  11. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/api/evaluate.py +0 -0
  12. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/api/get_visualize_handle.py +0 -0
  13. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/api/instancing_model.py +0 -0
  14. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/core/__init__.py +0 -0
  15. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/core/apgstmd_core.py +0 -0
  16. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/core/apgstmdv2_core.py +0 -0
  17. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/core/base_core.py +0 -0
  18. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/core/dstmd_core.py +0 -0
  19. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/core/estmd_backbone.py +0 -0
  20. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/core/estmd_core.py +0 -0
  21. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/core/feedbackstmd_core.py +0 -0
  22. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/core/fracstmd_core.py +0 -0
  23. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/core/fstmd_core.py +0 -0
  24. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/core/fstmdv2_core.py +0 -0
  25. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/core/haarstmd_core.py +0 -0
  26. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/core/stfeedbackstmd_core.py +0 -0
  27. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/core/stmdplus_core.py +0 -0
  28. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/core/stmdplusv2_core.py +0 -0
  29. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/core/vstmd_core.py +0 -0
  30. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/demo/evaluate_model.py +0 -0
  31. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/demo/inference_gui.py +0 -0
  32. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/demo/inference_gui_single_process.py +0 -0
  33. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/demo/inference_image_stream.py +0 -0
  34. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/demo/inference_video.py +0 -0
  35. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/main.py +0 -0
  36. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/model/__init__.py +0 -0
  37. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/model/backbone.py +0 -0
  38. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/model/facilitated_model.py +0 -0
  39. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/model/haarstmd.py +0 -0
  40. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/model/vstmd.py +0 -0
  41. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/util/__init__.py +0 -0
  42. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/util/compute_module.py +0 -0
  43. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/util/create_kernel.py +0 -0
  44. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/util/evaluate_module.py +0 -0
  45. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/util/iostream.py +0 -0
  46. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp/util/stmd.ico +0 -0
  47. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp.egg-info/SOURCES.txt +0 -0
  48. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp.egg-info/dependency_links.txt +0 -0
  49. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp.egg-info/entry_points.txt +0 -0
  50. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp.egg-info/requires.txt +0 -0
  51. {xttmp-2.3.0.7 → xttmp-2.3.0.8}/src/xttmp.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xttmp
3
- Version: 2.3.0.7
3
+ Version: 2.3.0.8
4
4
  Summary: eXtremely Tiny Target - Motion Perception
5
5
  Author-email: Shawn MX <mingshuoxu@hotmail.com>
6
6
  Project-URL: Homepage, https://github.com/MingshuoXu/Small-Target-Motion-Detectors
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "xttmp"
7
- version = "2.3.0.7"
7
+ version = "2.3.0.8"
8
8
  description = "eXtremely Tiny Target - Motion Perception"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -114,31 +114,30 @@ class GammaDelay(BaseCore):
114
114
  Implements a gamma filter used in the lamina layer of the ESTMD neural network
115
115
  using pure PyTorch and collections.deque for efficient temporal sliding windows.
116
116
  """
117
- def __init__(self, order=1, tau=1.0, kernel_len=None):
117
+ def __init__(self, order=1, tau=1.0):
118
118
  """
119
119
  Constructor method.
120
120
 
121
121
  Parameters:
122
122
  order (int): Order of the gamma filter (n). Default is 1.
123
123
  tau (float): Time constant of the filter (\tau).
124
- kernel_len (int): Length of the filter kernel (T).
125
124
  """
126
125
  super().__init__()
127
126
  self.order = max(1, int(order))
128
127
  self.tau = tau
129
- # 如果未指定长度,默认使用 3 * tau (覆盖大部分有效权重)
130
- self.kernel_len = int(3 * tau) if kernel_len is None else kernel_len
128
+
131
129
 
132
130
  self.setup()
133
131
 
134
132
  def setup(self):
133
+ _kernel_len = int(3 * self.tau)
135
134
  # 1. 预计算 Gamma 滤波器的时域权重
136
- kernel = create_gamma_kernel(self.order, self.tau, self.kernel_len)
135
+ kernel = create_gamma_kernel(self.order, self.tau, _kernel_len)
137
136
  # 注册为 buffer,随模型自动转移设备 (如 .cuda())
138
137
  self.register_buffer('gamma_kernel', kernel)
139
138
 
140
139
  # 2. 初始化双端队列作为时序状态缓存区
141
- self.buffer = deque(maxlen=self.kernel_len)
140
+ self.buffer = deque(maxlen=_kernel_len)
142
141
 
143
142
  def reset_buffer(self):
144
143
  """
@@ -179,15 +178,13 @@ class GammaBandPassFilter(BaseCore):
179
178
 
180
179
  def __init__(self,
181
180
  order1=2, tau1=3.0,
182
- order2=6, tau2=9.0,
183
- kernel_len=None):
181
+ order2=6, tau2=9.0):
184
182
  """
185
183
  Constructor method.
186
184
 
187
185
  Parameters:
188
186
  - order1, tau1: Parameters for the excitatory (positive) Gamma filter.
189
187
  - order2, tau2: Parameters for the inhibitory (negative) Gamma filter.
190
- - kernel_len: Temporal length of the filter. If None, auto-calculated.
191
188
  """
192
189
  super().__init__()
193
190
 
@@ -196,17 +193,15 @@ class GammaBandPassFilter(BaseCore):
196
193
  self.order2 = max(1, int(order2))
197
194
  self.tau2 = tau2
198
195
 
199
- # 自动计算所需的历史帧缓存最大长度
200
- self.kernel_len = kernel_len if kernel_len is not None else max(int(3 * tau1), int(3 * tau2))
201
-
202
196
  self.in_loop = False # 默认不覆盖历史帧,直接追加
203
197
 
204
198
  self.setup()
205
199
 
206
200
  def setup(self):
201
+ _kernel_len = max(int(3 * self.tau1), int(3 * self.tau2))
207
202
  # 1. 预计算两个 Gamma 滤波器的权重,并补齐到相同的长度 self.T
208
- k1 = create_gamma_kernel(self.order1, self.tau1, self.kernel_len)
209
- k2 = create_gamma_kernel(self.order2, self.tau2, self.kernel_len)
203
+ k1 = create_gamma_kernel(self.order1, self.tau1, _kernel_len)
204
+ k2 = create_gamma_kernel(self.order2, self.tau2, _kernel_len)
210
205
 
211
206
  # 2. 算子融合 (Operator Fusion):W_bandpass = W1 - W2
212
207
  # 直接将差值注册为模型的 buffer,前向传播只需计算一次
@@ -214,7 +209,7 @@ class GammaBandPassFilter(BaseCore):
214
209
  self.register_buffer('bandpass_kernel', bandpass_kernel)
215
210
 
216
211
  # 3. 初始化单一的高效时序状态缓存区
217
- self.buffer = deque(maxlen=self.kernel_len)
212
+ self.buffer = deque(maxlen=_kernel_len)
218
213
 
219
214
  def reset_buffer(self):
220
215
  """
@@ -41,8 +41,8 @@ class FeedbackSTMD(ESTMDBackbone):
41
41
  # lamina
42
42
  'n1' : 'lamina.order1', # Eq. (3)
43
43
  'tau1' : 'lamina.tau1',
44
- 'n2' : 'lamina.order1',
45
- 'tau2' : 'lamina.tau1',
44
+ 'n2' : 'lamina.order2',
45
+ 'tau2' : 'lamina.tau2',
46
46
  # medulla
47
47
  'n3' : ('medulla.tm1.order', 'medulla.mi1.order'), # Eq. (7)
48
48
  'tau3' : ('medulla.tm1.tau', 'medulla.mi1.tau'),
@@ -70,15 +70,11 @@ class FeedbackSTMD(ESTMDBackbone):
70
70
  # Customize Lobula component
71
71
  self.lobula = feedbackstmd_core.Lobula()
72
72
 
73
- # Customize Lamina's GammaBankPassFilter properties
74
- self.lamina.order1 = 4
75
- self.lamina.tau1 = 8
76
- self.lamina.order2 = 16
77
- self.lamina.tau2 = 32
78
-
79
- # Customize Medulla's Tm1 component properties
80
- self.medulla.tm1.order = 9
81
- self.medulla.tm1.tau = 45
73
+ self.set_para(n1=4, tau1=8,
74
+ n2=16, tau2=32,
75
+ n3=9, tau3=45)
76
+
77
+ self.setup()
82
78
 
83
79
  def forward(self, x):
84
80
  """ MODEL_STRUCTURE Method
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xttmp
3
- Version: 2.3.0.7
3
+ Version: 2.3.0.8
4
4
  Summary: eXtremely Tiny Target - Motion Perception
5
5
  Author-email: Shawn MX <mingshuoxu@hotmail.com>
6
6
  Project-URL: Homepage, https://github.com/MingshuoXu/Small-Target-Motion-Detectors
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes