Skip to content

Commit

Permalink
Initial library commit
Browse files Browse the repository at this point in the history
  • Loading branch information
WorldThirteen committed Jul 5, 2018
1 parent c8126dd commit ecb2626
Show file tree
Hide file tree
Showing 310 changed files with 17,792 additions and 3 deletions.
15 changes: 15 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"presets": [
[
"env",
{ "modules": false }
]
],
"compact": "false",
"plugins": [],
"env": {
"test": {
"presets": [["env"]]
}
}
}
32 changes: 32 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: 2

jobs:
build:
docker:
- image: circleci/node:8.2.1-browsers
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}-{{ checksum "app/package.json" }}
- run:
name: install-npm-dependencies
command: 'npm install && cd app && npm install'
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}-{{ checksum "app/package.json" }}
paths:
- /node_modules
- /app/node_modules
- run:
name: run-lint-command
command: 'npm run lint'
- run:
name: run-test-command
command: 'npm run test'
- deploy:
name: deploy-to-gh-pages
when: on_success
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
# Deploy to gh-pages
cd app && npm run deploy:gh-pages
fi
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
dist-es6/
40 changes: 40 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"parser": "babel-eslint",
"env": {
"browser": true,
"es6": true,
"mocha": true
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"generators": true,
"modules": true,
"objectLiteralDuplicateProperties": true
}
},
"extends": "airbnb",
"rules": {
"no-underscore-dangle": 0,
"import/extensions": 0,
"import/no-unresolved": 0,
"import/prefer-default-export": 1,
"no-restricted-syntax": 0,
"guard-for-in": 1,
"no-bitwise": 0,
"no-continue": 0,
"prefer-destructuring": 0,
"no-restricted-globals": 0,
"prefer-promise-reject-errors": 0,
"no-mixed-operators": 0,
"no-param-reassign": 0,
"padding-line-between-statements": [
"error",
{ "blankLine": "always", "prev": ["const", "let", "var"], "next": "*"},
{ "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"]},
{ "blankLine": "always", "prev": "*", "next": "return" }
],
"global-require": 0
}
}
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
node_modules
dst/
.idea
.vscode
*.log
compiled_env.json
package-lock.json
*.sketch
dist/
dist-es6/
app/_data
.backup
1 change: 0 additions & 1 deletion CNAME

This file was deleted.

23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Contributing to GammaCV

From opening a bug report to creating a pull request: every contribution is appreciated and welcome. If you're planning to implement a new feature or change the api please create an issue first.

## Bug report
A good bug report shouldn't leave others needing to chase you for more information. Please try to be as detailed as possible in your report.

## Give feedback on issues
Some issues are created without important information. Help make them easier to resolve by adding any relevant information.

## Fix bugs and implement features
Confirmed bugs and ready-to-implement features are marked with the help wanted label. Post a comment on an issue to indicate you would like to work on it.

## Documentation
We greatly appreciate any time spent fixing typos or clarifying sections in the documentation.

## Submitting Changes
After getting some feedback, push to your fork and submit a pull request. We may suggest some changes or improvements or alternatives, but for small changes your pull request should be accepted quickly.

Some things that will increase the chance that your pull request is accepted:
- Write tests
- Follow the existing coding style, check with `npm run lint`
- Write a good commit message
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) 2017

Permission is hereby granted, free of charge, to any person 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 permission notice shall be included in all copies or substantial portions of the Software.

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.
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[![CircleCI](https://circleci.com/gh/PeculiarVentures/GammaCV.svg?style=svg&circle-token=4d5c9d9ac8f27f4b8319b3d4c8bc6da22bb27462)](https://circleci.com/gh/PeculiarVentures/GammaCV)

## General
---
#### GammaCV is a WebGL accelerated Computer Vision library for modern web applications.

We created GammaCV to make it easy to integrate Computer Vision in modern web applications. GammaCV was built with a similar architecture to TensorFlow, in particular, it also uses a data flow paradigm to create and run graphs on GPU, this enables the robust image processing and feature extraction capability of the library.

## Installation

To install the stable version:

```bash
npm install --save gammacv
```

This assumes you are using [npm](https://www.npmjs.com/) as your package manager.

## Documentation
You can find the GammaCV documentation [on the website](https://gammacv.com/docs).

## Examples
You can find the GammaCV examples [on the website](https://gammacv.com/examples).

## Want to help?
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for [contribution](https://github.com/peculaiarventures/gammacv/blob/master/CONTIBUTING.md).

## Tests
### Install modules
```bash
npm i
```
### Run tests
```bash
npm run test
```
### Run test server to test any browser/device
```bash
npm run test-server
```

## Core Contributors
[Arkadiy Pilguk](https://github.com/apilguk)
[Mihail Zachepilo](https://github.com/WorldThirteen)
[Dmitriy Donskov](https://github.com/donskov)
[Ihor Pchelnik](https://github.com/p1nta)
[Rostyslav Kravchenko](https://github.com/RostyslavKravchenko)
[Andrii Omelianenko](https://github.com/andrOmelianenko)
13 changes: 13 additions & 0 deletions app/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"presets": [
"env",
"stage-0",
"react"
],
"compact": "false",
"plugins": [
"dynamic-import-node",
"transform-runtime"
],
"env": {}
}
1 change: 1 addition & 0 deletions app/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/src/assets/static
36 changes: 36 additions & 0 deletions app/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"parser": "babel-eslint",
"env": {
"browser": true,
"es6": true,
"mocha": true
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": false,
"generators": true,
"modules": true,
"objectLiteralDuplicateProperties": true
}
},
"extends": "airbnb",
"rules": {
"no-underscore-dangle": 0,
"import/extensions": 0,
"import/no-unresolved": 0,
"import/prefer-default-export": 1,
"no-restricted-syntax": 0,
"guard-for-in": 1,
"no-bitwise": 0,
"no-continue": 0,
"prefer-destructuring": 0,
"no-restricted-globals": 0,
"prefer-promise-reject-errors": 0,
"no-mixed-operators": 0,
"react/jsx-no-bind": 0,
"jsx-a11y/anchor-is-valid": 0,
"no-await-in-loop": 0
}
}
2 changes: 1 addition & 1 deletion LICENSE → app/LICENSE.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018
Copyright (c) 2017

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
29 changes: 29 additions & 0 deletions app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# GammaCV Sample Application

#### Run development
```bash
npm run development
```
Visit [http://localhost:3000](http://localhost:3000)

#### Run production
```bash
npm run production
```
Visit [http://localhost:3000](http://localhost:3000)

### Build and deploy to gh-pages
```bash
npm run deploy
```

#### Run linter
```bash
npm run lint
```

#### Run tests
```bash
npm run test
```
For running tests in WebStorm add a Extra Mocha options `--compilers js:babel-core/register`
41 changes: 41 additions & 0 deletions app/app_config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
export default {
version: 0.2,
languages: ['en'],
defaultLanguage: 'en',
forceHTTPS: false,
autoReloadOnNewVerison: true,
shells: [
'index',
'landing',
'not_found',
'main',
'examples',
'docs',
'example',
],
endpoints: {
'/': 'main',
'/examples': 'examples',
'/examples/:id': 'example',
'/docs': 'docs',
'/docs/:type': 'docs',
'/docs/:type/:subtype': 'docs',
'*': 'not_found',
},
source: [{
name: 'bootstrap',
path: './bootstrap.js',
}],
notListenPopstate: true,
resources: {
backend: () => import(/* webpackChunkName: "backend" */'./src/backend.js'),
container: name => import(/* webpackChunkName: "container-[request]" */`./src/containers/${name}/index.jsx`),
shell: name => import(/* webpackChunkName: "shells-[request]" */`./src/shells/${name}/manifest.js`),
// lang: () => import(/* webpackChunkName: "lang-[request]" */'./src/assets/langs/en/index'),
lang: () => {
const name = 'index';
return import(/* webpackChunkName: "lang-[request]" */`./src/assets/langs/en/${name}`);
},
script: (shell, name) => import(/* webpackChunkName: "shells-[request]" */`./src/shells/${shell}/scripts/${name}`),
},
};
59 changes: 59 additions & 0 deletions app/bundler/compile_enviropment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import fs from 'fs';
import path from 'path';
import dotenv from 'dotenv'; // eslint-disable-line
import uuid from './utils/uuid';
import hash from './utils/hash';

const debug = require('./utils/debug')('app:environmentCompiler');

const compileEnviorment = () => {
const ENV_FILE_PATH = path.resolve(process.env.ENV_FILE || path.join(__dirname, '../env/development'));

debug(`Reading configuration for '${ENV_FILE_PATH}'`);

const rawConfig = fs.readFileSync(ENV_FILE_PATH);

debug(`Finished reading configuration for '${ENV_FILE_PATH}'`);

// Parse the raw file
const configData = dotenv.parse(rawConfig);
const configKeys = Object.keys(configData);
debug(`Parsed configuration and got ${configKeys.length} keys...`);


// Allow overriding env values through ENV vars
const keysChanged = [];

for (let i = 0; i <= configKeys.length; i += 1) {
const k = configKeys[i];
if (!process.env[k]) continue;
keysChanged.push(k);
configData[k] = process.env[k];
}

const commitHash = hash();
let buildInfo = `${uuid()}_${commitHash}`;

if (process.env.CIRCLE_BUILD_NUM && process.env.CIRCLE_SHA1) {
buildInfo = `${process.env.CIRCLE_BUILD_NUM}_${process.env.CIRCLE_SHA1}`;
}

configData.BUILD_INFO = buildInfo;
configData.HASH = commitHash;

debug(`Updated ${keysChanged.length} keys with overridden values...`);

// Update process.env with values also.
for (let i = 0; i <= configKeys.length; i += 1) {
process.env[configKeys[i]] = configData[configKeys[i]];
}

// Write the file so that the browser can read the compiled variables.
const compiledDestination = path.resolve(__dirname, 'compiled_env.json');
debug(`Writing config to ${compiledDestination}`);
fs.writeFileSync(compiledDestination, JSON.stringify(configData, null, 2));

debug('Finished compiling environment file!');
};

compileEnviorment();
Loading

0 comments on commit ecb2626

Please sign in to comment.