atomashpolskiy / atomashpolskiy/rustface

Safe code only version

Open
#45 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
436
Forks
40
PR merge metrics
No merged PRs in 30d

Description

I made [version](https://github.com/jutuon/rustface/tree/safe) of this library with safe code only. The example program produces exactly the same output image as the version with unsafe code using the bundled test image. The performance is unsuprisingly a bit worse.

```none
MacBook Air M1 2020 and library's rayon feature is disabled.

Commit 271563b, safe code only:
detect_single_image/detect
time: [334.29 ms 334.36 ms 334.44 ms]

Commit fa3d5b5, includes unsafe:
detect_single_image/detect
time: [327.55 ms 327.83 ms 328.05 ms]
```

I think next step to optimize the safe version would be to check if nalgebra could be used in some places to make calculations use SIMD. However, I don't plan to optimize the code any further.

I didn't open PR for this because of the performance decrease, but I can open it if wanted.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by comparing the safe branch with the unsafe implementation, then run the example program with the bundled test image and the detect_single_image/detect benchmark, with the rayon feature disabled. Done means the safe version's output remains identical and the project has a decided path for accepting or rejecting the performance tradeoff.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-vision
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.