-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...areddata/xcbaselines/MentalistTests.xcbaseline/16945756-61C2-4E9B-B3DD-A87D97D8D455.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>classNames</key> | ||
<dict> | ||
<key>MentalistTests</key> | ||
<dict> | ||
<key>testAnalyzeTime()</key> | ||
<dict> | ||
<key>com.apple.XCTPerformanceMetric_WallClockTime</key> | ||
<dict> | ||
<key>baselineAverage</key> | ||
<real>6.540000</real> | ||
<key>baselineIntegrationDisplayName</key> | ||
<string>Local Baseline</string> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
40 changes: 40 additions & 0 deletions
40
.swiftpm/xcode/xcshareddata/xcbaselines/MentalistTests.xcbaseline/Info.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>runDestinationsByUUID</key> | ||
<dict> | ||
<key>16945756-61C2-4E9B-B3DD-A87D97D8D455</key> | ||
<dict> | ||
<key>localComputer</key> | ||
<dict> | ||
<key>busSpeedInMHz</key> | ||
<integer>0</integer> | ||
<key>cpuCount</key> | ||
<integer>1</integer> | ||
<key>cpuKind</key> | ||
<string>Apple M2 Pro</string> | ||
<key>cpuSpeedInMHz</key> | ||
<integer>0</integer> | ||
<key>logicalCPUCoresPerPackage</key> | ||
<integer>12</integer> | ||
<key>modelCode</key> | ||
<string>Mac14,10</string> | ||
<key>physicalCPUCoresPerPackage</key> | ||
<integer>12</integer> | ||
<key>platformIdentifier</key> | ||
<string>com.apple.platform.macosx</string> | ||
</dict> | ||
<key>targetArchitecture</key> | ||
<string>arm64</string> | ||
<key>targetDevice</key> | ||
<dict> | ||
<key>modelCode</key> | ||
<string>iPhone16,1</string> | ||
<key>platformIdentifier</key> | ||
<string>com.apple.platform.iphonesimulator</string> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,67 @@ | ||
# Mentalist | ||
|
||
[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager) | ||
|
||
![banner](Assets/banner.jpg) | ||
|
||
<div align="center"> | ||
<h3> Read face with a line of code </h3> | ||
</div> | ||
|
||
```swift | ||
let analysis = try Mentalist.analyze(image: Image("my_face")).first! | ||
|
||
print("The emotion on your face is... '\(analysis.dominantEmotion)!'") | ||
// "The emotion on your face is... 'happy'! | ||
``` | ||
|
||
## Features | ||
|
||
**Mentalist** is a Swift-based library designed for analyzing and identifying emotions within a picture. | ||
|
||
### 1. Seven Emotion Categories | ||
|
||
Mentalist classifies the emotions on faces in a photo into **one of seven categories**. Internally, it utilizes a CoreML model based on FER2013 to analyze emotions displayed in a picture into seven categories: 'happy', 'angry', 'disgust', 'fear', 'happy', 'sad', 'surprise', and 'neutral'. | ||
|
||
### 2. Optimized for Mobile Environment | ||
|
||
Mentalist has an optimal size for mobile environments. It also takes approximately **0.06 seconds per analysis** with an **accuracy rate of about 57%**. | ||
|
||
### 3. Supports Multi-Face Analysis | ||
|
||
Mentalist can detect multiple faces. If multiple faces are detected, it returns a list of multiple analysis results. | ||
|
||
## Installation | ||
|
||
### Swift Package Manager (SPM) | ||
|
||
Follow these steps to install Mentalist using SPM: | ||
|
||
1. From within Xcode 13 or later, choose File > Swift Packages > Add Package Dependency. | ||
2. At the next screen, enter the URL for the Mentalist repository(https://github.com/enebin/Mentalist) in the search bar then click Next. | ||
3. For the version rule, select 'Up to Next Minor' and specify the current Mentalist version then click 'Next'. | ||
4. On the final screen, select the Mentalist library and then click 'Finish'. | ||
|
||
Mentalist should now be integrated into your project 🚀. | ||
|
||
## Usage | ||
|
||
```swift | ||
import Mentalist | ||
|
||
let analysis = try Mentalist.analyze(image: Image("my_face")) | ||
``` | ||
|
||
Done! | ||
|
||
## Contributing | ||
|
||
We welcome contributions to Mentalist! If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome. | ||
|
||
## License | ||
|
||
Mentalist is released under the MIT License. See [LICENSE](LICENSE) for details. | ||
|
||
## Contact | ||
|
||
For any questions or suggestions, please feel free to contact me. My email's on my Github profile. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters