add unitask / add rotation

This commit is contained in:
2023-06-03 08:55:57 +05:00
parent 1055fb47b6
commit dccf25674e
339 changed files with 70773 additions and 696 deletions
+10 -11
View File
@@ -14,7 +14,7 @@ namespace UltraFace
#region Editable attributes
[SerializeField] bool _useBodyTracking;
[SerializeField] ImageSource _source = null;
[SerializeField] FixedImageSource _source = null;
[SerializeField, Range(0, 1)] float _threshold = 0.5f;
[SerializeField] ResourceSet _faceResources = null;
@@ -76,8 +76,8 @@ namespace UltraFace
_drawArgs.SetData(new [] {6, 0, 0, 0});
_detectedCounter = new List<bool>();
_bodyDetector = new BodyDetector(_bodyResources, 320, 240);
_bodyMaterial = new Material(_bodyShader);
// _bodyDetector = new BodyDetector(_bodyResources, 320, 240);
// _bodyMaterial = new Material(_bodyShader);
//_bodyPreviewUI.material = _bodyMaterial;
}
@@ -103,19 +103,21 @@ namespace UltraFace
if(!_detectionSetup.isValidate) return;
_detectedCounter.Add(maxFaceHeight > _detectionSetup.minFaceHeight ? true : false);
if(_detectedCounter.Count == 128)
_detectedCounter.Add(maxFaceHeight >= _detectionSetup.correctFaceHeight ? true : false);
if(_detectedCounter.Count == 32)
{
var trueCounter = _detectedCounter.Count(x => x == true);
var falseCounter = _detectedCounter.Count(x => x == false);
if(!_isDetected && trueCounter >= 64)
Debug.LogWarning($"распознаваний: верных - {trueCounter}, неверных - {falseCounter}");
if(!_isDetected && trueCounter > falseCounter)
{
if(maxFaceHeight < _detectionSetup.minFaceHeight) return;
_isDetected = true;
OnDetectionStatusChanged?.Invoke(_isDetected);
Debug.LogWarning("лицо определено");
}
else if(_isDetected && trueCounter < 64)
else if(_isDetected && trueCounter < falseCounter)
{
_isDetected = false;
OnDetectionStatusChanged?.Invoke(_isDetected);
@@ -123,9 +125,6 @@ namespace UltraFace
}
_detectedCounter = new List<bool>();
}
if(Input.GetKeyDown(KeyCode.Space))
OnDetectionStatusChanged?.Invoke(!_isDetected);
}
void OnRenderObject()