Skip to content

Commit

Permalink
add Licenses and Readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
vennelakodali committed Mar 3, 2020
1 parent 07703d5 commit 2acd133
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 25 deletions.
13 changes: 0 additions & 13 deletions LICENSE

This file was deleted.

23 changes: 23 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Copyright 2020 Bendyworks

Hippocratic License Version 2.0.

Licensor hereby grants permission by this license ("License"), free of charge, to any person or entity (the "Licensee") obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:


* The above copyright notice and this License or a subsequent version published on the Hippocratic License Website (https://firstdonoharm.dev/) shall be included in all copies or substantial portions of the Software. Licensee has the option of following the terms and conditions either of the above numbered version of this License or of any subsequent version published on the Hippocratic License Website.

* Compliance with Human Rights Laws and Human Rights Principles:

1. Human Rights Laws. The Software shall not be used by any person or entity for any systems, activities, or other uses that violate any applicable laws, regulations, or rules that protect human, civil, labor, privacy, political, environmental, security, economic, due process, or similar rights (the "Human Rights Laws"). Where the Human Rights Laws of more than one jurisdiction are applicable to the use of the Software, the Human Rights Laws that are most protective of the individuals or groups harmed shall apply.

2. Human Rights Principles. Licensee is advised to consult the articles of the United Nations Universal Declaration of Human Rights (https://www.un.org/en/universal-declaration-human-rights/) and the United Nations Global Compact (https://www.unglobalcompact.org/what-is-gc/mission/principles) that define recognized principles of international human rights (the "Human Rights Principles"). It is Licensor's express intent that all use of the Software be consistent with Human Rights Principles. If Licensor receives notification or otherwise learns of an alleged violation of any Human Rights Principles relating to Licensee's use of the Software, Licensor may in its discretion and without obligation (i) (a) notify Licensee of such allegation and (b) allow Licensee 90 days from notification under (i)(a) to investigate and respond to Licensor regarding the allegation and (ii) (a) after the earlier of 90 days from notification under (i)(a), or Licensee's response under (i)(b), notify Licensee of License termination and (b) allow Licensee an additional 90 days from notification under (ii)(a) to cease use of the Software.

3. Indemnity. Licensee shall hold harmless and indemnify Licensor against all losses, damages, liabilities, deficiencies, claims, actions, judgments, settlements, interest, awards, penalties, fines, costs, or expenses of whatever kind, including Licensor's reasonable attorneys' fees, arising out of or relating to Licensee's non-compliance with this License or use of the Software in violation of Human Rights Laws or Human Rights Principles.

* Enforceability: If any portion or provision of this License is determined to be invalid, illegal, or unenforceable by a court of competent jurisdiction, then such invalidity, illegality, or unenforceability shall not affect any other term or provision of this License or invalidate or render unenforceable such term or provision in any other jurisdiction. Upon a determination that any term or provision is invalid, illegal, or unenforceable, to the extent permitted by applicable law, the court may modify this License to affect the original intent of the parties as closely as possible. The section headings are for convenience only and are not intended to affect the construction or interpretation of this License. Any rule of construction to the effect that ambiguities are to be resolved against the drafting party shall not apply in interpreting this License. The language in this License shall be interpreted as to its fair meaning and not strictly for or against any party.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

This Hippocratic License is an Ethical Source license (https://ethicalsource.dev).
42 changes: 30 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
# Capacitor Plugin to detect text in images
# Cap-ML

Machine Learning Plugin for Capacitor. Here are the features currently offered -
- Text Detection in still images:
We're using Apple's Vision Framework. There are some limitations like not being able to detect cursive/handwriting font etc.
(It is also assumed that the picture is sent in portrait mode. ) # TODO: ?


## Installation

## iOS Setup and Instructions
```
# Install Plugin
npm install cap-ml
# Sync the ios project
npx cap sync ios
```

## Android Setup
(Not Supported)

## Usage

In an Angular project, it can be imported like:
TODO: Should I write up something for a react app too ?

```
import { Plugins } from '@capacitor/core';
const { Camera, CapML } = Plugins;
```

and where you wish to use the plugin -
and used like:
```
# prompt the user to select a picture
imageFile = await Camera.getPhoto({
resultType: CameraResultType.Uri,
source: CameraSource.Photos,
})
# pass in the picture to 'text-detector'
# pass in the picture to 'CapML' plugin
var response = await CapML.detectText({filename: imageFile.path!})
textDetections = response.detectedText;
Expand All @@ -41,6 +44,21 @@ and where you wish to use the plugin -
topRight = detection.topRight
})
A complete example can be found in the examples folder - examples/text-detection/ImageReader
(Sample project is an Ionic-Angular App)
TODO: should I do a sample react app too ?
```

A complete example can be found here - '#TODO: to be filled in'
## Development

After checking out the repo, run `npm install` to install dependencies.
To test it out,
- navigate to examples/text-detection/ImageReader
- run `npm install`
- run `npx capacitor open ios`. This opens an XCode project.
- Run the XCode project either on a simulator or a device.
TODO: these instructions look very straight forward. Repeat the process to make sure all steps are covered and what problems might occur ??

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/bendyworks/cap-ml.
23 changes: 23 additions & 0 deletions examples/text-detection/ImageReader/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Copyright 2020 Bendyworks

Hippocratic License Version 2.0.

Licensor hereby grants permission by this license ("License"), free of charge, to any person or entity (the "Licensee") obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:


* The above copyright notice and this License or a subsequent version published on the Hippocratic License Website (https://firstdonoharm.dev/) shall be included in all copies or substantial portions of the Software. Licensee has the option of following the terms and conditions either of the above numbered version of this License or of any subsequent version published on the Hippocratic License Website.

* Compliance with Human Rights Laws and Human Rights Principles:

1. Human Rights Laws. The Software shall not be used by any person or entity for any systems, activities, or other uses that violate any applicable laws, regulations, or rules that protect human, civil, labor, privacy, political, environmental, security, economic, due process, or similar rights (the "Human Rights Laws"). Where the Human Rights Laws of more than one jurisdiction are applicable to the use of the Software, the Human Rights Laws that are most protective of the individuals or groups harmed shall apply.

2. Human Rights Principles. Licensee is advised to consult the articles of the United Nations Universal Declaration of Human Rights (https://www.un.org/en/universal-declaration-human-rights/) and the United Nations Global Compact (https://www.unglobalcompact.org/what-is-gc/mission/principles) that define recognized principles of international human rights (the "Human Rights Principles"). It is Licensor's express intent that all use of the Software be consistent with Human Rights Principles. If Licensor receives notification or otherwise learns of an alleged violation of any Human Rights Principles relating to Licensee's use of the Software, Licensor may in its discretion and without obligation (i) (a) notify Licensee of such allegation and (b) allow Licensee 90 days from notification under (i)(a) to investigate and respond to Licensor regarding the allegation and (ii) (a) after the earlier of 90 days from notification under (i)(a), or Licensee's response under (i)(b), notify Licensee of License termination and (b) allow Licensee an additional 90 days from notification under (ii)(a) to cease use of the Software.

3. Indemnity. Licensee shall hold harmless and indemnify Licensor against all losses, damages, liabilities, deficiencies, claims, actions, judgments, settlements, interest, awards, penalties, fines, costs, or expenses of whatever kind, including Licensor's reasonable attorneys' fees, arising out of or relating to Licensee's non-compliance with this License or use of the Software in violation of Human Rights Laws or Human Rights Principles.

* Enforceability: If any portion or provision of this License is determined to be invalid, illegal, or unenforceable by a court of competent jurisdiction, then such invalidity, illegality, or unenforceability shall not affect any other term or provision of this License or invalidate or render unenforceable such term or provision in any other jurisdiction. Upon a determination that any term or provision is invalid, illegal, or unenforceable, to the extent permitted by applicable law, the court may modify this License to affect the original intent of the parties as closely as possible. The section headings are for convenience only and are not intended to affect the construction or interpretation of this License. Any rule of construction to the effect that ambiguities are to be resolved against the drafting party shall not apply in interpreting this License. The language in this License shall be interpreted as to its fair meaning and not strictly for or against any party.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

This Hippocratic License is an Ethical Source license (https://ethicalsource.dev).
24 changes: 24 additions & 0 deletions examples/text-detection/ImageReader/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Image Reader

Sample Ionic+Angular App that uses 'cap-ml' plugin to detect text in images

## Install Prerequisites
This is an Ionic Project, so install ionic globally like this -
`npm install -g @ionic/cli`

## Running the App

- Checkout the repository at https://github.com/bendyworks/cap-ml
- Navigate to examples/text-detection/ImageReader
- Install dependencies - `npm install`
- Build the project - `npm run build` or `ionic build`
- Make sure the app is running fine without issues - `ionic serve` This will run the app and serve it on localhost.
- Since this is really an ios Plugin, open the app in XCode using `npx cap open ios`
- Once XCode opens up, run the app either on a simulator or device.
- Once the app opens up, click on 'Pick a Picture' and select a picture with some text.
- App will immediately process the image and present text detections on the image chosen.
- Click on the highlighted regions to get the text in that location.

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/bendyworks/cap-ml.

0 comments on commit 2acd133

Please sign in to comment.