Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ARM64 support #1018

Merged
merged 4 commits into from
Feb 6, 2023
Merged

Add ARM64 support #1018

merged 4 commits into from
Feb 6, 2023

Conversation

NHellFire
Copy link
Contributor

@NHellFire NHellFire commented Jan 23, 2023

This upgrades libraries to versions that have arm64 wheels available, and builds the remaining ones (imagecodecs) from source. I've only build-tested this as I currently don't have a spare arm64 device to test on, but the test suite passed:

#22 120.0 ==== 39 passed, 1 skipped, 45 deselected, 18 warnings in 101.35s (0:01:41) =====

If anyone wants to test this, you can build the images natively with make from the embedding-calculator folder. Or cross-build and export the image using:

docker buildx build -t compreface-core:arm64 --platform linux/arm64 --progress plain .
docker image save -o compreface-core-arm64.tar compreface-core:arm64

And import with:

docker image load -i compreface-core-arm64.tar

Fixes #610, possibly also #519 (I haven't tested building the CUDA images yet).

Marking as draft for now, as I still need to update the Makefile to use buildkit and try building the CUDA images. I'll also look at building imagecodecs in a separate container to reduce the final image size.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 23, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️

@NHellFire
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@pospielov
Copy link
Collaborator

Hi @NHellFire, thanks for this fantastic contribution!
The main concern is that the new version should have backward compatibility with the new one.
I mean that the embeddings that compreface-core returns should be the same in the current CompreFace version and after your changes. In this way, old installations won't be broken.
The easiest way to check it is to install the current CompreFace version, upload one image to face collection, and test on another image (preferably on another person), and write down the similarity. Then, install your version and use the same volume for DB. And test the same image on the same service. The similarity should be the same.
Could you do this?

@NHellFire
Copy link
Contributor Author

Using a v1.1.0 database with my branch produced an identical recognition result for these test images.

Images used:

Results for the first test image are:

v1.1.0 (x86_64 host):

Similarity: 0.17
Male, Age: 25-32

{
  "result": [ {
      "age": {
        "probability": 0.9716785550117493,
        "high": 32,
        "low": 25
      },
      "gender": {
        "probability": 1,
        "value": "male"
      },
      "box": {
        "probability": 0.99986,
        "x_max": 1863,
        "y_max": 1202,
        "x_min": 1012,
        "y_min": 218
      },
      "subjects": [ {
          "subject": "A",
          "similarity": 0.16651
        } ],
      "landmarks": [ [ 1324,
          643 ],
        [ 1591,
          652 ],
        [ 1478,
          814 ],
        [ 1328,
          911 ],
        [ 1575,
          915 ] ]
    } ]
}

feature/arm64 (x86_64 host, same database):

Similarity: 0.17
Male, Age: 25-32

{
  "result": [ {
      "age": {
        "probability": 0.9716785550117493,
        "high": 32,
        "low": 25
      },
      "gender": {
        "probability": 1,
        "value": "male"
      },
      "box": {
        "probability": 0.99986,
        "x_max": 1863,
        "y_max": 1202,
        "x_min": 1012,
        "y_min": 218
      },
      "subjects": [ {
          "subject": "A",
          "similarity": 0.16651
        } ],
      "landmarks": [ [ 1324,
          643 ],
        [ 1591,
          652 ],
        [ 1478,
          814 ],
        [ 1328,
          911 ],
        [ 1575,
          915 ] ]
    } ]
}

@pospielov pospielov marked this pull request as ready for review February 3, 2023 18:18
@pospielov pospielov merged commit 8e2725d into exadel-inc:master Feb 6, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible used CompareFace docker on Raspberry PI ?
2 participants