-
Notifications
You must be signed in to change notification settings - Fork 90
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 FaceID Examples for MAX78002, Add requirements.txt for db_gen Utility, Fix AttributeError for db_gen Utility #537
Add FaceID Examples for MAX78002, Add requirements.txt for db_gen Utility, Fix AttributeError for db_gen Utility #537
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no Feather for MAX78002. Remove this figure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This picture needs to be updated to MAX78002 EVKIT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this figure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - just a minor updated needed to the readme.
I also need to do 2 things before merging. I'll get the items below done asap.
-
Create a requirements.txt for the
db_gen
utility. I had some issues last week with my ai8x-synthesis venv generating unexpected embeddings with the utility. Victor identified potential dependency issues. I will validate a clean venv against the prerequisites listed in the readme to confirm and create a requirements.txt file. -
Run an MSDKGen update to sync the project files with the latest v1.6.0
#include "embedding_process.h" | ||
#include "keypad.h" | ||
|
||
#if 0 // Custom camera settings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
PR_DEBUG("Camera Manufacture ID is %04x\n", id); | ||
|
||
#if 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here - remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
* Uncomment `TFT = ADAFRUIT` in [project.mk](project.mk) to use drivers for the legacy [Adafruit 3315](https://www.adafruit.com/product/3315). Otherwise, the default drivers for the [NewHaven NHD-2.4-240320CF](https://newhavendisplay.com/2-4-inch-premium-spi-resistive-tft-display/) will be used. | ||
|
||
### Load firmware image to MAX78002 EVKIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this section in favor of pointing to the MSDK User Guide. See the new MSDKGen README template for the new recommended sections.
i.e. just add...
### Project Usage
Universal instructions on building, flashing, and debugging this project can be found in the **[MSDK User Guide](https://analog-devices-msdk.github.io/msdk/USERGUIDE/)**.
... Underneath the ##FaceID Demo Software
section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
- AttributeError: module 'numpy' has no attribute 'int'. `np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'inf'?
Added requirements.txt (616549c), and on a clean virtual environment the db_gen works as expected. FYI for numpy > 1.20 /home/jakecarter/repos/fork/msdk/Examples/MAX78002/CNN/faceid_evkit/db_gen/mtcnn/utils/detect_face.py:70: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:206.)
imgs = torch.as_tensor(imgs, device=device) # pylint: disable=no-member
Traceback (most recent call last):
File "/home/jakecarter/repos/fork/msdk/Examples/MAX78002/CNN/faceid_evkit/./db_gen/generate_face_db.py", line 95, in <module>
main()
File "/home/jakecarter/repos/fork/msdk/Examples/MAX78002/CNN/faceid_evkit/./db_gen/generate_face_db.py", line 91, in main
create_db_from_folder(args)
File "/home/jakecarter/repos/fork/msdk/Examples/MAX78002/CNN/faceid_evkit/./db_gen/generate_face_db.py", line 57, in create_db_from_folder
embedding_db, _ = append_db_file_from_path(args.db, face_detector, ai85_adapter,
File "/home/jakecarter/repos/fork/msdk/Examples/MAX78002/CNN/faceid_evkit/db_gen/utils.py", line 196, in append_db_file_from_path
img = get_face_image(img, mtcnn)
File "/home/jakecarter/repos/fork/msdk/Examples/MAX78002/CNN/faceid_evkit/db_gen/utils.py", line 263, in get_face_image
img_arr, _, _, _ = generate_image(img, box, 1)
File "/home/jakecarter/repos/fork/msdk/Examples/MAX78002/CNN/faceid_evkit/db_gen/utils.py", line 295, in generate_image
new_box = np.round(new_box).astype(np.int)
File "/home/jakecarter/repos/fork/msdk/Examples/MAX78002/CNN/faceid_evkit/venv/lib/python3.10/site-packages/numpy/__init__.py", line 305, in __getattr__
raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'int'.
`np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'inf'? |
Also FYI: I updated the readme with jumper settings here: 7e1b7f2 After testing, I found that the camera initialization was unreliable. The default jumper settings install extra pull-ups that degrade the communication. All I2C1 pull-ups on the EVKIT should be uninstalled, since the DVP Camera Adapter board has built-in I2C pull-ups. With that issue resolved, the camera initialization became reliable and the demo functions as expected. |
|
No description provided.