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
from sys import platform as _platform | |
import numpy as np | |
from six.moves import urllib | |
import tensorflow as tf | |
from flask import Flask, jsonify, render_template, request | |
PWD = '/var/www/html/flaskapp' | |
MODEL_PATH = PWD + '/data/output_graph.pb' | |
LABELS_PATH = PWD + '/data/output_labels.txt' |
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
import { Injectable } from '@angular/core'; | |
import { Http, ConnectionBackend, Request, RequestOptions, RequestOptionsArgs, Response, Headers } from '@angular/http'; | |
import { Observable } from 'rxjs/Observable'; | |
import 'rxjs/add/observable/throw'; | |
import 'rxjs/Rx'; | |
import { PreloaderService } from './preloader-service'; | |
import { Config } from '../config'; | |
@Injectable() | |
export class HttpService extends Http { |
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
import { Injectable } from '@angular/core'; | |
@Injectable() | |
export class PreloaderService { | |
public static fullLoadingCount: number = 0; | |
public static smallLoadingCount: number = 0; | |
getPreloaderCount(preloaderType = 'full'): number { | |
if (preloaderType === 'full') { | |
return PreloaderService.fullLoadingCount; |
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
<div class="preloader-small" | |
*ngIf="preloaderService.getPreloaderCount('small') > 0 && preloaderService.getPreloaderCount('full') == 0" | |
></div> |
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
import { Component } from '@angular/core'; | |
import { PreloaderService } from '../../services/preloader-service'; | |
@Component({ | |
selector: 'preloader-small', | |
styleUrls: [ | |
'./preloader-small.scss' | |
], | |
templateUrl: './preloader-small.html' | |
}) |
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
<div class="preloader-full" | |
*ngIf="preloaderService.getPreloaderCount('full') > 0"> | |
<div class="preloader-full__spinner">💩</div> | |
</div> |
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
import { Component } from '@angular/core'; | |
import { PreloaderService } from '../../services/preloader-service'; | |
@Component({ | |
selector: 'preloader-full', | |
styleUrls: [ | |
'./preloader-full.scss' | |
], | |
templateUrl: './preloader-full.html' | |
}) |
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
private requestInterceptor(): void { | |
this.loaderService.showPreloader(); | |
} |
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
get(url: string, options?: RequestOptionsArgs): Observable<any> { | |
this.requestInterceptor(); | |
return super.get(this.getFullUrl(url), this.requestOptions(options)) | |
.catch(this.onCatch) | |
.do((res: Response) => { | |
this.onSubscribeSuccess(res); | |
}, (error: any) => { | |
this.onSubscribeError(error); | |
}) | |
.finally(() => { |
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
import { Injectable } from '@angular/core'; | |
import { | |
Http, | |
ConnectionBackend, | |
RequestOptions, | |
RequestOptionsArgs, | |
Response, | |
Headers | |
} from '@angular/http'; | |
import { Observable } from 'rxjs/Observable'; |
NewerOlder