This repository has been archived by the owner on Nov 16, 2024. It is now read-only.
forked from kaneshin/pigeon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add “Adding a Vision feature“ section to contributing
- Loading branch information
Edoardo La Greca
committed
Mar 18, 2024
1 parent
624b278
commit 0d18b42
Showing
1 changed file
with
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Contributing | ||
|
||
## Adding a Vision feature | ||
|
||
To add a Google Cloud Vision feature support to Dovelet (both the utility and the library), you need to change two files: `feature.go` and `cmd/dovelet/flag.go`. | ||
|
||
In `feature.go`, you need to: | ||
|
||
1. Add a constant to the `DetectionFeature` enumeration. The new constant must be named after the feature to add. | ||
2. Add a `case` in `DetectionFeature`'s `VisionFeature` function. That new case translates the new constant to its respective Vision-specific value. | ||
|
||
In `cmd/dovelet/flag.go`, you need to: | ||
|
||
1. Add a new boolean field to the `CLArgs` structure. | ||
2. Add a new command line argument in the `ParseArgs` function. To do so: | ||
1. Create a new variable named after the new feature. Assign the value returned by `f.Bool` to that variable, called with proper argument values. | ||
2. Assign the variable's value to the new field in the `CLArgs` instance. The value needs to be de-referenced. | ||
3. Add a `case` in `CLArgs`'s `Feature` function. That case maps the new command line argument with the previously added feature (from `feature.go`). |