A CLI tool for analyzing the contents of an image.
Note: This repo is currently a work-in-progress so the information may not be complete, accurate, or final.
- Golang - version >= 1.11 (must support Go modules)
- Amazon Rekognition
- Amazon S3
- Amazon Dynamo DB
-
detect-objects
Description Detects objects in an image.
Example
./image-ai detect-objects --image-path ~/pictures/photo1.png
Required flags
--image-path
[relative path to image file] -
describe-face
- WIPDescription Detects the largest face in the image and returns a description of the face.
Example
./image-ai describe-face --image-path ~/pictures/photo1.png
Required flags
--image-path
[relative path to image file] -
compare-faces
- WIPDescription Compares the largest face in the source and the target image to identify if they are of the same person. The target image can be in a collection or supplied by the user.
Example
./image-ai compare-faces --src-image-path ~/pictures/photo1.png --target-image-path ~/pictures/photo2.png
Required flags
--src-image-path
[relative path to image file]Optional flags (must select one)
--target-image-path
[relative path to image file]--collection
[collection name]
-
collection
- WIPUse the following commands to manage a collection of images.
-
list
Description List collections in the AWS account
Example
./image-ai collection list
-
create
Description Create a new collection
Example
./image-ai collection create [collection name]
Required args
--collection-name
[name of collection] -
delete
Description Delete a collection
Example
./image-ai collection delete [collection name]
Required args
--collection-name
[name of collection]] -
add-image
Description Add an image to a collection
Example
./image-ai collection add-image --collection-name myCollection --image-path ~/pictures/photo1.png
Required args
--collection-name
[name of collection]--image-path
[relative path to image file]
-
delete-image
(TBD - might change)Description Delete an image from a collection
Example
./image-ai collection delete-image --collection-name myCollection --file-name photo1.png
Required args
--collection-name
[name of collection]--file-name
[file name to match the S3 key for the image file]
-
--aws-region
- Default value is us-west-2
--aws-profile
- Default value is default
- Install git and golang, if not installed already.
- Create an AWS account if you don't have one.
- This program authenticates with your AWS account credentials stored in
~/.aws/credentials
. If you don't have this setup yet, install the AWS CLI and runaws configure
. For more information on configuration, see AWS CLI configuration documentation - See here for image formats/sizes accepted by Amazon Rekognition
- Clone this repository and
cd
into the repo root directory. - Run
go build
in your terminal. This will create an executableimage-ai
file. - Run
./image-ai [additional arugments here]
to run the program. - For a faster development iteration, instead of steps 2 and 3, you can also run
go run main.go [additional arugments here]