fix: Change the structure of builder
This commit is contained in:
@@ -56,9 +56,10 @@ impl FaceDetectionBuilder {
|
||||
}
|
||||
|
||||
impl FaceDetection {
|
||||
pub fn builder<T: AsRef<[u8]>>()
|
||||
-> fn(T) -> std::result::Result<FaceDetectionBuilder, Report<Error>> {
|
||||
FaceDetectionBuilder::new
|
||||
pub fn builder<T: AsRef<[u8]>>(
|
||||
model: T,
|
||||
) -> std::result::Result<FaceDetectionBuilder, error_stack::Report<crate::errors::Error>> {
|
||||
FaceDetectionBuilder::new(model)
|
||||
}
|
||||
|
||||
pub fn new(path: impl AsRef<Path>) -> Result<Self> {
|
||||
|
||||
@@ -119,10 +119,10 @@ impl FaceDetectionBuilder {
|
||||
}
|
||||
|
||||
impl FaceDetection {
|
||||
pub fn builder<T: AsRef<[u8]>>()
|
||||
-> fn(T) -> std::result::Result<FaceDetectionBuilder, error_stack::Report<crate::errors::Error>>
|
||||
{
|
||||
FaceDetectionBuilder::new
|
||||
pub fn builder<T: AsRef<[u8]>>(
|
||||
model: T,
|
||||
) -> std::result::Result<FaceDetectionBuilder, error_stack::Report<crate::errors::Error>> {
|
||||
FaceDetectionBuilder::new(model)
|
||||
}
|
||||
|
||||
pub fn new(path: impl AsRef<Path>) -> crate::errors::Result<Self> {
|
||||
@@ -134,7 +134,7 @@ impl FaceDetection {
|
||||
|
||||
pub fn new_from_bytes(model: &[u8]) -> crate::errors::Result<Self> {
|
||||
tracing::info!("Loading ORT RetinaFace model from bytes");
|
||||
Self::builder()(model)?.build()
|
||||
Self::builder(model)?.build()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user