diff --git a/README.md b/README.md index 0bd391f..fbd15e4 100644 --- a/README.md +++ b/README.md @@ -1 +1,12 @@ -# objectImageIdentifierAI \ No newline at end of file +# objectImageIdentifierAI + +- imagesToDataset + - From two directories ('object' and 'noobject'), gets all the images inside the directories and generates the dataset +- nnTrain + - From the dataset file generated in the previous step, train the Neural Network +- serverPredictor + - Runs a server API, that with the Neural Network classifies the incoming images +- smartphoneApp + - Take photo and upload to the server, to get the response (object or no object) + +![hotdognohotdog](https://raw.githubusercontent.com/arnaucode/objectImageIdentifierAI/master/hotdognohotdog.png "hotdognohotdog") diff --git a/hotdognohotdog.png b/hotdognohotdog.png new file mode 100644 index 0000000..443c5e5 Binary files /dev/null and b/hotdognohotdog.png differ diff --git a/smartphoneApp/.bowerrc b/smartphoneApp/.bowerrc new file mode 100644 index 0000000..e28246d --- /dev/null +++ b/smartphoneApp/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "www/lib" +} diff --git a/smartphoneApp/.editorconfig b/smartphoneApp/.editorconfig new file mode 100644 index 0000000..aca2523 --- /dev/null +++ b/smartphoneApp/.editorconfig @@ -0,0 +1,14 @@ +# http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +insert_final_newline = false +trim_trailing_whitespace = false \ No newline at end of file diff --git a/smartphoneApp/.gitignore b/smartphoneApp/.gitignore new file mode 100644 index 0000000..0f734e2 --- /dev/null +++ b/smartphoneApp/.gitignore @@ -0,0 +1,7 @@ +# Specifies intentionally untracked files to ignore when using Git +# http://git-scm.com/docs/gitignore + +node_modules/ +platforms/ +plugins/ +www/lib diff --git a/smartphoneApp/README.md b/smartphoneApp/README.md new file mode 100644 index 0000000..d7cf744 --- /dev/null +++ b/smartphoneApp/README.md @@ -0,0 +1,26 @@ +Ionic App Base +============== + +A starting project for Ionic that optionally supports using custom SCSS. + +## Using this project + +We recommend using the [Ionic CLI](https://github.com/ionic-team/ionic-cli) to create new Ionic projects that are based on this project but use a ready-made starter template. + +For example, to start a new Ionic project with the default tabs interface, make sure the `ionic` utility is installed: + +```bash +$ npm install -g ionic cordova +``` + +Then run: + +```bash +$ ionic start myProject tabs --type=ionic1 +``` + +More info on this can be found on the Ionic [Getting Started](https://ionicframework.com/getting-started) page and the [Ionic CLI](https://github.com/ionic-team/ionic-cli) repo. + +## Issues + +Issues have been disabled on this repo. If you do find an issue or have a question, consider posting it on the [Ionic Forum](https://forum.ionicframework.com/). If there is truly an error, follow our guidelines for [submitting an issue](https://ionicframework.com/submit-issue/) to the main Ionic repository. diff --git a/smartphoneApp/bower.json b/smartphoneApp/bower.json new file mode 100644 index 0000000..ea21e74 --- /dev/null +++ b/smartphoneApp/bower.json @@ -0,0 +1,7 @@ +{ + "name": "HelloIonic", + "private": "true", + "devDependencies": { + "ionic": "ionic-team/ionic-bower#1.3.4" + } +} diff --git a/smartphoneApp/config.xml b/smartphoneApp/config.xml new file mode 100644 index 0000000..d86b1e2 --- /dev/null +++ b/smartphoneApp/config.xml @@ -0,0 +1,93 @@ + + + MyApp + An awesome Ionic/Cordova app. + Ionic Framework Team + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/smartphoneApp/gulpfile.js b/smartphoneApp/gulpfile.js new file mode 100644 index 0000000..a73233c --- /dev/null +++ b/smartphoneApp/gulpfile.js @@ -0,0 +1,27 @@ +var gulp = require('gulp'); +var sass = require('gulp-sass'); +var cleanCss = require('gulp-clean-css'); +var rename = require('gulp-rename'); + +var paths = { + sass: ['./scss/**/*.scss'] +}; + +gulp.task('default', ['sass']); + +gulp.task('sass', function(done) { + gulp.src('./scss/ionic.app.scss') + .pipe(sass()) + .on('error', sass.logError) + .pipe(gulp.dest('./www/css/')) + .pipe(cleanCss({ + keepSpecialComments: 0 + })) + .pipe(rename({ extname: '.min.css' })) + .pipe(gulp.dest('./www/css/')) + .on('end', done); +}); + +gulp.task('watch', ['sass'], function() { + gulp.watch(paths.sass, ['sass']); +}); diff --git a/smartphoneApp/hooks/README.md b/smartphoneApp/hooks/README.md new file mode 100644 index 0000000..d2563ea --- /dev/null +++ b/smartphoneApp/hooks/README.md @@ -0,0 +1,83 @@ + +# Cordova Hooks + +This directory may contain scripts used to customize cordova commands. This +directory used to exist at `.cordova/hooks`, but has now been moved to the +project root. Any scripts you add to these directories will be executed before +and after the commands corresponding to the directory name. Useful for +integrating your own build systems or integrating with version control systems. + +__Remember__: Make your scripts executable. + +## Hook Directories +The following subdirectories will be used for hooks: + + after_build/ + after_compile/ + after_docs/ + after_emulate/ + after_platform_add/ + after_platform_rm/ + after_platform_ls/ + after_plugin_add/ + after_plugin_ls/ + after_plugin_rm/ + after_plugin_search/ + after_prepare/ + after_run/ + after_serve/ + before_build/ + before_compile/ + before_docs/ + before_emulate/ + before_platform_add/ + before_platform_rm/ + before_platform_ls/ + before_plugin_add/ + before_plugin_ls/ + before_plugin_rm/ + before_plugin_search/ + before_prepare/ + before_run/ + before_serve/ + pre_package/ <-- Windows 8 and Windows Phone only. + +## Script Interface + +All scripts are run from the project's root directory and have the root directory passes as the first argument. All other options are passed to the script using environment variables: + +* CORDOVA_VERSION - The version of the Cordova-CLI. +* CORDOVA_PLATFORMS - Comma separated list of platforms that the command applies to (e.g.: android, ios). +* CORDOVA_PLUGINS - Comma separated list of plugin IDs that the command applies to (e.g.: org.apache.cordova.file, org.apache.cordova.file-transfer) +* CORDOVA_HOOK - Path to the hook that is being executed. +* CORDOVA_CMDLINE - The exact command-line arguments passed to cordova (e.g.: cordova run ios --emulate) + +If a script returns a non-zero exit code, then the parent cordova command will be aborted. + + +## Writing hooks + +We highly recommend writting your hooks using Node.js so that they are +cross-platform. Some good examples are shown here: + +[http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/](http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/) + diff --git a/smartphoneApp/hooks/after_prepare/010_add_platform_class.js b/smartphoneApp/hooks/after_prepare/010_add_platform_class.js new file mode 100755 index 0000000..bda3e41 --- /dev/null +++ b/smartphoneApp/hooks/after_prepare/010_add_platform_class.js @@ -0,0 +1,94 @@ +#!/usr/bin/env node + +// Add Platform Class +// v1.0 +// Automatically adds the platform class to the body tag +// after the `prepare` command. By placing the platform CSS classes +// directly in the HTML built for the platform, it speeds up +// rendering the correct layout/style for the specific platform +// instead of waiting for the JS to figure out the correct classes. + +var fs = require('fs'); +var path = require('path'); + +var rootdir = process.argv[2]; + +function addPlatformBodyTag(indexPath, platform) { + // add the platform class to the body tag + try { + var platformClass = 'platform-' + platform; + var cordovaClass = 'platform-cordova platform-webview'; + + var html = fs.readFileSync(indexPath, 'utf8'); + + var bodyTag = findBodyTag(html); + if(!bodyTag) return; // no opening body tag, something's wrong + + if(bodyTag.indexOf(platformClass) > -1) return; // already added + + var newBodyTag = bodyTag; + + var classAttr = findClassAttr(bodyTag); + if(classAttr) { + // body tag has existing class attribute, add the classname + var endingQuote = classAttr.substring(classAttr.length-1); + var newClassAttr = classAttr.substring(0, classAttr.length-1); + newClassAttr += ' ' + platformClass + ' ' + cordovaClass + endingQuote; + newBodyTag = bodyTag.replace(classAttr, newClassAttr); + + } else { + // add class attribute to the body tag + newBodyTag = bodyTag.replace('>', ' class="' + platformClass + ' ' + cordovaClass + '">'); + } + + html = html.replace(bodyTag, newBodyTag); + + fs.writeFileSync(indexPath, html, 'utf8'); + + process.stdout.write('add to body class: ' + platformClass + '\n'); + } catch(e) { + process.stdout.write(e); + } +} + +function findBodyTag(html) { + // get the body tag + try{ + return html.match(/])(.*?)>/gi)[0]; + }catch(e){} +} + +function findClassAttr(bodyTag) { + // get the body tag's class attribute + try{ + return bodyTag.match(/ class=["|'](.*?)["|']/gi)[0]; + }catch(e){} +} + +if (rootdir) { + + // go through each of the platform directories that have been prepared + var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []); + + for(var x=0; x + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/smartphoneApp/www/js/app.js b/smartphoneApp/www/js/app.js new file mode 100644 index 0000000..4b8ba07 --- /dev/null +++ b/smartphoneApp/www/js/app.js @@ -0,0 +1,44 @@ + +angular.module('app', [ + 'ionic', + 'app.main', + 'app.menu' +]) + + .run(function($ionicPlatform) { + $ionicPlatform.ready(function() { + // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard + // for form inputs) + if (window.cordova && window.cordova.plugins.Keyboard) { + cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); + cordova.plugins.Keyboard.disableScroll(true); + + } + if (window.StatusBar) { + // org.apache.cordova.statusbar required + StatusBar.styleDefault(); + } + }); + }) + + .config(function($stateProvider, $urlRouterProvider) { + $stateProvider + + .state('app', { + url: '/app', + abstract: true, + templateUrl: 'templates/menu.html', + controller: 'MenuCtrl' + }) + + .state('app.main', { + url: '/main', + views: { + 'menuContent': { + templateUrl: 'templates/main.html' + } + } + }); + // if none of the above states are matched, use this as the fallback + $urlRouterProvider.otherwise('/app/main'); + }); diff --git a/smartphoneApp/www/js/main.js b/smartphoneApp/www/js/main.js new file mode 100644 index 0000000..6f36e16 --- /dev/null +++ b/smartphoneApp/www/js/main.js @@ -0,0 +1,5 @@ +angular.module('app.main', []) + +.controller('MainCtrl', function($scope) { + +}); diff --git a/smartphoneApp/www/js/menu.js b/smartphoneApp/www/js/menu.js new file mode 100644 index 0000000..6156dab --- /dev/null +++ b/smartphoneApp/www/js/menu.js @@ -0,0 +1,5 @@ +angular.module('app.menu', []) + +.controller('MenuCtrl', function($scope) { + +}); diff --git a/smartphoneApp/www/manifest.json b/smartphoneApp/www/manifest.json new file mode 100644 index 0000000..5738a4d --- /dev/null +++ b/smartphoneApp/www/manifest.json @@ -0,0 +1,12 @@ + +{ + "name": "My Ionic App", + "short_name": "My Ionic App", + "start_url": "index.html", + "display": "standalone", + "icons": [{ + "src": "icon.png", + "sizes": "512x512", + "type": "image/png" + }] +} \ No newline at end of file diff --git a/smartphoneApp/www/service-worker.js b/smartphoneApp/www/service-worker.js new file mode 100644 index 0000000..a090018 --- /dev/null +++ b/smartphoneApp/www/service-worker.js @@ -0,0 +1,12 @@ + +self.addEventListener('activate', function (event) { + +}); + +self.addEventListener('fetch', function (event) { + +}); + +self.addEventListener('push', function (event) { + +}); \ No newline at end of file diff --git a/smartphoneApp/www/templates/main.html b/smartphoneApp/www/templates/main.html new file mode 100644 index 0000000..3cbe951 --- /dev/null +++ b/smartphoneApp/www/templates/main.html @@ -0,0 +1,26 @@ + + +
+
+
+ Take Photo +
+
+
+
+ From Gallery +
+
+
+ + +
+
diff --git a/smartphoneApp/www/templates/menu.html b/smartphoneApp/www/templates/menu.html new file mode 100644 index 0000000..28a589d --- /dev/null +++ b/smartphoneApp/www/templates/menu.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + +

Menu

+
+ + + + Main + + + +
+