PERF 修改视频切片长度为输入长度
This commit is contained in:
@@ -96,7 +96,13 @@ def test_node(image:torch.Tensor,length=10,thres=95,model_name="convnext_tiny"):
|
||||
end = nums[idx]
|
||||
if end - start + 1 >= length:
|
||||
period.append([start, end])
|
||||
return (image.permute(0,2,3,1), image.permute(0,2,3,1)[nums,:,:,:], str(preds), str(probs), str(nums), period)
|
||||
temp_period = []
|
||||
for i in period:
|
||||
a = i[0]
|
||||
while a+length-1 <= i[1]:
|
||||
temp_period.append([a,a+length-1])
|
||||
a = a+length
|
||||
return (image.permute(0,2,3,1), image.permute(0,2,3,1)[nums,:,:,:], str(preds), str(probs), str(nums), temp_period)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user