Facial Recognition

This commit is contained in:
venbainfotech 2022-05-02 17:26:32 +05:30
parent 6f3613fe88
commit 812c0a3292
22 changed files with 16219 additions and 3887 deletions

View File

@ -1,4 +0,0 @@
{
"javascript.implicitProjectConfig.experimentalDecorators": true,
"git.ignoreLimitWarning": true
}

View File

@ -1,2 +0,0 @@
# sparqsineedge

View File

@ -1,30 +0,0 @@
# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:10.15.3
pipelines:
branches:
master:
- step:
caches:
- node
size: 2x # Double resources available for this step.
script: # Modify the commands below to build your repository.
- cd ng6-seed
- npm install
- npm install -g @angular/cli
- node --max_old_space_size=2046 node_modules/@angular/cli/bin/ng build --configuration=staging
- ls -ltr
- cd dist
- pipe: atlassian/aws-s3-deploy:0.3.8
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: 'ap-south-1'
S3_BUCKET: 'autodeploy001'
LOCAL_PATH: $(pwd)
DELETE_FLAG: 'true'

View File

@ -1,3 +0,0 @@
{
"lockfileVersion": 1
}

19178
ng6-seed/package-lock.json generated Executable file → Normal file

File diff suppressed because it is too large Load Diff

View File

@ -33,8 +33,6 @@
"@ngx-translate/http-loader": "^3.0.1",
"@swimlane/ngx-charts": "^7.0.1",
"@swimlane/ngx-datatable": "11.1.5",
"@swimlane/ngx-dnd": "^9.0.0",
"@swimlane/ngx-ui": "^37.1.1",
"@types/file-saver": "^2.0.1",
"amazon-cognito-identity-js": "^2.0.30",
"angular-calendar": "0.23.3",
@ -46,6 +44,7 @@
"chart.js": "2.6.0",
"core-js": "^2.6.11",
"d3": "^4.9.1",
"drag-drop": "^7.2.0",
"dragula": "3.7.2",
"file-saver": "^2.0.5",
"firebase": "^6.6.2",
@ -74,7 +73,7 @@
"ngx-socket-io": "^3.0.1",
"ngx-spinner": "^7.2.0",
"ngx-viewer": "^1.0.5",
"node-sass": "^4.14.1",
"node-sass": "^4.13.0",
"perfect-scrollbar": "^1.3.0",
"quill": "^1.3.7",
"recordrtc": "^5.5.9",
@ -99,6 +98,7 @@
"@types/node": "^8.10.59",
"aws-sdk": "^2.600.0",
"codelyzer": "~4.1.0",
"gulp-sass": "^5.0.0",
"jasmine-core": "2.6.3",
"jasmine-spec-reporter": "4.1.0",
"karma": "1.7.0",

View File

@ -163,7 +163,7 @@
<mat-icon>sms</mat-icon>
</button> -->
<button mat-button mat-icon-button class="mb-1 hover-icon" type="button" color="primary" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string)"
<button mat-button mat-icon-button class="mb-1 hover-icon" type="button" color="primary" (click)="viewPD(details.is_child == 0 ? details.pd_id : details.parent_pd_id,details.random_string,details.is_face_api_enabled)"
matTooltip="View" matTooltipPosition="above">
<mat-icon>visibility</mat-icon>
</button>

View File

@ -98,8 +98,10 @@ export class AllPdComponent implements OnInit, OnChanges {
data => {
if (data.status == 200) {
this.PdListData = data.records;
console.log(this.PdListData)
this.dataLengthTab1 = data.records.length;
this.dataSourceTab1.data = this.PdListData;
console.log(this.dataSourceTab1.data)
this.recordStatus=false;
}
else{
@ -118,7 +120,8 @@ export class AllPdComponent implements OnInit, OnChanges {
pageChange(e) {
console.log(e);
}
viewPD(pdid:string,randomString){
viewPD(pdid:string,randomString,faceApiEnabled){
localStorage.setItem("is_face_api_enabled",faceApiEnabled)
console.log(pdid,randomString);
let pdidwithRandomString = {'id':pdid,'string': randomString};
console.log(pdidwithRandomString);

View File

@ -0,0 +1,116 @@
<div style="max-height: 580px;">
<!-- <form [formGroup]="_duplicatePDFrom" (submit)="onSubmit()"> -->
<div class="ml-xs mr-xs" style="width: 100%;" fxLayout="row" fxLayoutAlign="center">
<h2 mat-dialog-title style="width: 50%;">Facial Recognition</h2>
<div style="width: 20%;"></div>
<div style="width: 30%;text-align:right;">
<button mat-raised-button mat-icon-button color="primary" class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above"
type="button" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
</div>
</div>
<div fxLayout="row">
<div fxFlex.xs="100%" fxFlex.sm="100%" fxFlex.md="100%" fxFlex.lg="100%" fxFlex.xl="100%">
<div fxLayout="row">
<mat-card *ngIf="rawData.nxt_action == null" fxFlex.xs="100%" fxFlex.sm="100%" fxFlex.md="50%" fxFlex.lg="50%" fxFlex.xl="50%" style="padding: 10px !important;">
<!-- <div fxLayout="row">
<div *ngFor="let item of color;let i=index" fxFlex.xs="100%" fxFlex.sm="20%" fxFlex.md="20%" fxFlex.lg="20%" fxFlex.xl="20%">
<button style="width: 20px;height: 20px;" [ngStyle]="{backgroundColor:item.color}" mat-raised-button></button><span>{{item.value}}%</span>
</div>
</div> -->
<!-- <mat-card-header> -->
<!-- <div mat-card-avatar class="example-header-image"></div> -->
<!-- <mat-card-title>{{member.title}}</mat-card-title> -->
<!-- <mat-card-subtitle>{{member.subtitle}}</mat-card-subtitle> -->
<!-- </mat-card-header> -->
<!-- <div *ngIf="rawData.nxt_action == 'null'"> -->
<img *ngIf="imgHide != true" mat-card-image [src]="aplicantDetails.is_person_met_pic" id="srcImg" alt="">
<canvas #layout [width]="getImageWidth" [height]="getImageHeigth"></canvas>
<!-- </div> -->
<!-- <mat-card-content>
<p>
{{member.content}}
</p>
</mat-card-content> -->
</mat-card>
<!-- <mat-card *ngIf="rawData.nxt_action == 'pick_src_img'" fxFlex.xs="100%" fxFlex.sm="100%" fxFlex.md="50%" fxFlex.lg="50%" fxFlex.xl="50%" style="padding: 10px !important;">
<img mat-card-image [src]="aplicantDetails.is_person_met_pic" id="srcImg" alt="" style="display: none !important;">
<canvas #layout [width]="getImageWidth" [height]="getImageHeigth" style="border:3px solid"></canvas>
</mat-card> -->
<mat-card fxFlex.xs="100%" fxFlex.sm="100%" fxFlex.md="50%" fxFlex.lg="50%" fxFlex.xl="50%" style="padding: 10px !important;">
<!-- <mat-card-header> -->
<!-- <div mat-card-avatar class="example-header-image"></div> -->
<!-- <mat-card-title>{{member.title}}</mat-card-title> -->
<!-- <mat-card-subtitle>{{member.subtitle}}</mat-card-subtitle> -->
<!-- </mat-card-header> -->
<img mat-card-image [src]="aplicantDetails.is_person_met_id_proof" alt="" style="height: 239px !important;">
<!-- <mat-card-content>
<p>
{{member.content}}
</p>
</mat-card-content> -->
</mat-card>
</div>
<!-- <div fxLayout="row">
<mat-card fxFlex.xs="100%" fxFlex.sm="100%" fxFlex.md="50%" fxFlex.lg="50%" fxFlex.xl="50%" style="padding: 10px !important;">
<canvas #layout style="border:3px solid"></canvas>
</mat-card>
</div> -->
</div>
<!-- <div fxFlex.xs="100%" fxFlex.sm="100%" fxFlex.md="40%" fxFlex.lg="40%" fxFlex.xl="40%">
<mat-card style="padding: 10px !important;"> -->
<!-- <mat-card style="padding: 10px !important;"> -->
<!-- <div fxFlex="row"> -->
<!-- <mat-card fxFlex.xs="100%" fxFlex.sm="100%" fxFlex.md="30%" fxFlex.lg="30%" fxFlex.xl="30%" style="padding: 10px !important;"> -->
<!-- <img mat-card-image [src]="aplicantDetails.is_person_met_pic" alt=""> -->
<!-- </mat-card> -->
<!-- <div fxLayoutAlign="center center" fxFlex.xs="100%" fxFlex.sm="100%" fxFlex.md="40%" fxFlex.lg="40%" fxFlex.xl="40%">
<span><mat-icon style="font-size: 34px !important;color: red !important;">block</mat-icon></span>
<span><mat-icon style="font-size: 34px !important;color: green !important;">check_circle</mat-icon></span>
</div>
<mat-card fxLayoutAlign="end center" fxFlex.xs="100%" fxFlex.sm="100%" fxFlex.md="30%" fxFlex.lg="30%" fxFlex.xl="30%" style="padding: 10px !important;">
<img mat-card-image [src]="aplicantDetails.is_person_met_id_proof" alt="">
</mat-card> -->
<!-- </div> -->
<!-- </mat-card> -->
<!-- [ngStyle]="{'background-color':similarity <= 30 ? 'red' : (similarity < 80 && this.similarity > 30 ? 'orange') : similarity >= 80 ? 'red'}" -->
<!-- <mat-card style="padding: 20px !important;" *ngIf="rawData.nxt_action == null">
<div fxLayout="row">
<div fxLayoutAlign="start center" fxFlex.xs="50%" fxFlex.sm="50%" fxFlex.md="50%" fxFlex.lg="50%" fxFlex.xl="50%">
<span style="font-size: 12px !important;">Similarity</span>
</div>
<div fxLayoutAlign="end center" fxFlex.xs="50%" fxFlex.sm="50%" fxFlex.md="50%" fxFlex.lg="50%" fxFlex.xl="50%">
<span style="font-size: 12px !important;">{{similarity}}%</span>
</div>
</div>
<div fxLayout="row">
<div fxLayoutAlign="start center" fxFlex.xs="100%" fxFlex.sm="100%" fxFlex.md="100%" fxFlex.lg="100%" fxFlex.xl="100%">
<mat-progress-bar mode="determinate" [value]="similarity"></mat-progress-bar> -->
<!-- <h5>{{similarity <= 30 ? 'Poor' : (similarity < 80 && this.similarity > 30 ? 'Good') : similarity >= 80 ? 'Excellent'}}</h5> -->
<!-- </div>
</div> -->
<!-- <div fxLayout="row">
<div fxLayoutAlign="start center" fxFlex.xs="100%" fxFlex.sm="100%" fxFlex.md="100%" fxFlex.lg="100%" fxFlex.xl="100%">
<canvas #layout [width]="getImageWidth" [height]="getImageHeigth" style="border:3px solid"></canvas>
</div>
</div> -->
<!-- <canvas #cropCut></canvas> -->
<!-- </mat-card>
<mat-card style="padding: 20px !important;" *ngIf="rawData.nxt_action == 'pick_src_img'">
<div fxLayout="row">
<canvas #myCanvas></canvas>
</div>
</mat-card>
</mat-card>
</div> -->
</div>
<!-- </form> -->
<ngx-spinner bdColor = "rgba(226,65,47,0.62)" size = "medium" color = "white" type = "timer" [fullScreen] = "true"><p style="color: #fff;"> Please Wait... </p></ngx-spinner>
</div>
<notifier-container></notifier-container>

View File

@ -0,0 +1,6 @@
// ::ng-deep .mat-progress-bar .mat-progress-bar-fill::after{
// background-color: attr(color) !important;
// }
::ng-deep .mat-dialog-container{
overflow: auto !important;
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FacialRecognitionModalComponent } from './facial-recognition-modal.component';
describe('FacialRecognitionModalComponent', () => {
let component: FacialRecognitionModalComponent;
let fixture: ComponentFixture<FacialRecognitionModalComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FacialRecognitionModalComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(FacialRecognitionModalComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,622 @@
import { Component, OnInit, Inject, ViewChild, ElementRef } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
import { NotifierService } from 'angular-notifier';
import { LoaderService } from 'app/shared/loaderService/loader.service';
@Component({
selector: 'app-facial-recognition-modal',
templateUrl: './facial-recognition-modal.component.html',
styleUrls: ['./facial-recognition-modal.component.scss']
})
export class FacialRecognitionModalComponent implements OnInit {
// isEditable: any = true
aplicantDetails: any = [];
private notifier: NotifierService;
pd_id: any= [];
faceMatchesDetails: any;
sourceImageFaceDetails: any;
similarity: any;
faceDetails: any;
color: any = [];
multiFaceDetails: any;
getImageWidth: number;
getImageHeigth: number;
@ViewChild('layout') canvasRef;
// @ViewChild('cropCut') canvasRef;
rawData: any = [];
baseURL: any;
imageBaseURL: any;
base64Image: any;
// @ViewChild('myCanvas')myCanvas: ElementRef<HTMLCanvasElement>;
public context: CanvasRenderingContext2D;
// Similarityfilterdata: any;
imgHide: boolean = false;
bondingDetails: any[];
// @ViewChild('layout') canvasRef;
// @ViewChild('myCanvas') myCanvas: ElementRef<HTMLCanvasElement>;
constructor(private loaderService:LoaderService,notifier: NotifierService,private _pd: PdTrigerService,private dialogRef: MatDialogRef<FacialRecognitionModalComponent>,
@Inject(MAT_DIALOG_DATA) public data: any) {
this.aplicantDetails = data.aplicantDetails
// this.aplicantDetails.is_person_met_id_proof = ''
// this.aplicantDetails.is_person_met_pic = 'https://media.istockphoto.com/photos/portrait-of-multi-ethnic-business-couple-picture-id1207862144?k=20&m=1207862144&s=612x612&w=0&h=fckYWdy8jqnq6rOXPgJ5ocKvhErnunAxkGaoG_OunD8='
this.pd_id = data.pdid
this.notifier = notifier;
console.log(this.aplicantDetails)
console.log(this.aplicantDetails)
// alert('constructor')
}
ngOnInit() {
// alert('ngOnInit')
this.faceComparsionDetails()
// this.imgSize()
// this.multiFaceComparsionDetails()
// this.getBase64ImageFromUrl(this.aplicantDetails.is_person_met_pic)
// this.getBase64ImageFromUrl(this.aplicantDetails.is_person_met_pic)
// console.log(this.getBase64ImageFromUrl(this.aplicantDetails.is_person_met_pic))
// let data = this.getBase64ImageFromUrl(this.aplicantDetails.is_person_met_pic)
// this.getBase64ImageFromUrl(this.aplicantDetails.is_person_met_pic)
// .then(result => this.aplicantDetails.is_person_met_pic = result)
// .catch(err => console.error(err));
// console.log(this.getBase64ImageFromUrl)
}
imgSize()
{
let myImg = document.querySelector('#srcImg');
console.log(myImg)
var currWidth = myImg.clientWidth;
var currHeight = myImg.clientHeight;
console.log(currWidth,currHeight)
// alert("Original width=" + currWidth + ", " + "Original height=" + currHeight);
this.getImageWidth = currWidth
this.getImageHeigth = currHeight
// return [currWidth,currHeight]
if(this.getImageWidth != null && this.getImageHeigth != null){
// alert('check')
this.imgHide = true
}
}
// getImageDimenstion(imgUrl){
// console.log(imgUrl)
// let img = new Image();
// img = imgUrl;
// img.onload = function (event) {
// console.log(event)
// let loadedImage = event.currentTarget;
// // let width = loadedImage.width;
// // let height = loadedImage.height;
// // console.log('height: '+height);
// // console.log('width: '+width);
// }
// }
faceComparsionDetails(){
this.loaderService.showMatSpinnerDialog("Please wait...")
// {"fk_pd_id":this.pdMasterList.pd_id,"fk_form_id":this.pd_all_details.form_id}
let params= {
"pdid": this.pd_id,
"dest": this.aplicantDetails.is_person_met_pic,
"src": this.aplicantDetails.is_person_met_id_proof,
// "dest":'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSvr4h42PFICLIeZYJNbpom1JyVQhZyhmAKqQ&usqp=CAU',
// "src": 'https://media.istockphoto.com/photos/portrait-of-multi-ethnic-business-couple-picture-id1207862144?k=20&m=1207862144&s=612x612&w=0&h=fckYWdy8jqnq6rOXPgJ5ocKvhErnunAxkGaoG_OunD8=',
"src_url_type": 'url',
"dest_url_type":'url'
}
// console.log(params)
// this.similarity = 80;
// console.log('after',this.similarity)
// if (this.similarity <= 30) {
// this.color = 'red'
// }
// else if (this.similarity < 80 && this.similarity > 30) {
// this.color = 'orange'
// }
// else if (this.similarity >= 80) {
// this.color = 'green'
// }
this._pd.facialComparsionApi(params).subscribe(result => {
this.rawData = result
console.log(this.rawData)
if (result.nxt_action == null) {
this.imgSize()
this.faceMatchesDetails = result.FaceMatches
console.log(this.faceMatchesDetails)
this.sourceImageFaceDetails = result.SourceImageFace
console.log(this.sourceImageFaceDetails)
// this.Similarityfilterdata = this.faceMatchesDetails.map(val=>({Similarity:val.Similarity}))
// console.log(this.Similarityfilterdata)
// console.log(this.Similarityfilterdata.length)
let filterdata = this.faceMatchesDetails.map(val=>({BoundingBox:val.Face.BoundingBox,Similarity:val.Similarity}))
console.log(filterdata)
console.log(filterdata.length)
// let bondingfilterdata = filterdata.map(val=>({BoundingBox:val.BoundingBox}))
// console.log(bondingfilterdata)
// console.log(bondingfilterdata.length)
var imageData = [];
for(let k=0;k<filterdata.length;k++){
console.log(filterdata[k]['BoundingBox']['Left']);
console.log(filterdata[k]['Similarity']);
console.log(filterdata[k].Similarity);
let Left_coordinate = filterdata[k]['BoundingBox']['Left'] * this.getImageWidth;
let Top_coordinate = filterdata[k]['BoundingBox']['Top'] * this.getImageHeigth;
let Face_width = filterdata[k]['BoundingBox']['Width'] * this.getImageWidth;
let Face_height = filterdata[k]['BoundingBox']['Height']* this.getImageHeigth;
console.log('Left_coordinate',Left_coordinate)
console.log('Top_coordinate',Top_coordinate)
console.log('Face_width',Face_width)
console.log('Face_height',Face_height)
// imageData[k]['Left_coordinate'] = Left_coordinate
// imageData[k]['Top_coordinate'] = Top_coordinate
// imageData[k]['Face_width'] = Face_width
// imageData[k]['Face_height'] = Face_height
let obj = {
'Left_coordinate' : Left_coordinate,
'Top_coordinate': Top_coordinate,
'Face_width': Face_width,
'Face_height':Face_height,
'Similarity': filterdata[k].Similarity
}
imageData.push(obj);
}
console.log(imageData)
this.bondingDetails = imageData
console.log(this.bondingDetails)
setTimeout(()=>{
this.drawRectangle(imageData)
// this.cropImg(imageData)
},1000);
// this.similarity = this.faceMatchesDetails[0].Similarity
// // let splitedValue = this.similarity.split(".")[0];
// // this.similarity = splitedValue
// this.similarity = this.similarity.toString();
// let atemp = this.similarity.split(".");
// this.similarity = atemp[0];
// console.log('befor',this.similarity)
// // this.similarity = 55;
// console.log('after',this.similarity)
// if (this.similarity <= 30) {
// this.color = 'red'
// }
// else if (this.similarity <= 70 && this.similarity > 30) {
// this.color = 'orange'
// }
// else if (this.similarity > 70) {
// this.color = 'green'
// }
// let qty = this.faceMatchesDetails[0].Face
// this.faceDetails = qty.Quality
// console.log(this.faceDetails)
// // console.log(this.faceDetails.Quality)
this.loaderService.closeMatSpinnerDialog();
}
else if (result.nxt_action == 'pick_src_img') {
// this.loaderService.showMatSpinnerDialog("Please wait...")
this.imgSize()
// console.log(this.imgSize(this.aplicantDetails.is_person_met_pic))
// const url= "https://www.w3schools.com/bootstrap/paris.jpg";
// this.getImageDimenstion(this.aplicantDetails.is_person_met_pic);
// this.AddFilesToFormData(this.aplicantDetails.is_person_met_pic)
console.log('entry',result)
this.multiFaceDetails = result.FaceDetails
console.log(this.multiFaceDetails)
// this.titleList=data.records.filter(val=>val.isactive==1);
let filterdata = this.multiFaceDetails.map(val=>({BoundingBox:val.BoundingBox}))
console.log(filterdata.length)
var imageData = [];
for(let k=0;k<filterdata.length;k++){
console.log(filterdata[k]['BoundingBox']['Left'] );
let Left_coordinate = filterdata[k]['BoundingBox']['Left'] * this.getImageWidth;
let Top_coordinate = filterdata[k]['BoundingBox']['Top'] * this.getImageHeigth;
let Face_width = filterdata[k]['BoundingBox']['Width'] * this.getImageWidth;
let Face_height = filterdata[k]['BoundingBox']['Height']* this.getImageHeigth;
console.log('Left_coordinate',Left_coordinate)
console.log('Top_coordinate',Top_coordinate)
console.log('Face_width',Face_width)
console.log('Face_height',Face_height)
// imageData[k]['Left_coordinate'] = Left_coordinate
// imageData[k]['Top_coordinate'] = Top_coordinate
// imageData[k]['Face_width'] = Face_width
// imageData[k]['Face_height'] = Face_height
let obj = {
'Left_coordinate' : Left_coordinate,
'Top_coordinate': Top_coordinate,
'Face_width': Face_width,
'Face_height':Face_height
}
imageData.push(obj);
// for(let k=0;k<filterdata.length;k++){
// //show in frondend bounding box value in radio
// document.getElementById("BoundingBox_Left").innerHTML = filterdata[k]['BoundingBox']['Left'];
// document.getElementById("BoundingBox_Top").innerHTML = filterdata[k]['BoundingBox']['Top'];
// document.getElementById("BoundingBox_Width").innerHTML = filterdata[k]['BoundingBox']['Width'];
// document.getElementById("BoundingBox_Height").innerHTML = filterdata[k]['BoundingBox']['Height'];
// }
// show in frondend bounding box value in pixel
// document.getElementById("Left_coordinate").innerHTML = Left_coordinate;
// document.getElementById("Top_coordinate").innerHTML = Top_coordinate;
// document.getElementById("Face_width").innerHTML = Face_width;
// document.getElementById("Face_height").innerHTML = Face_height;
}
console.log(imageData)
setTimeout(()=>{
this.drawRectangle(imageData)
// this.cropImg(imageData)
},1000);
this.loaderService.closeMatSpinnerDialog();
// this.multiFaceComparsionDetails()
// this.disableAfterSubmit = false;
// this.notifier.notify('warning', 'Something Went Wrong Try Again.! \t\"' + result.status +'\" Error Occur.!');
}
}, err => {
this.loaderService.closeMatSpinnerDialog();
// this.disableAfterSubmit = false;
// this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (err.error_type == 2 ? err.error_status + ' ( ' + err.error_text + ' ) ' : ' ( ' + err.error_text + ' ) ') +'\" Error Occur.!');
});
}
//other code here
drawRectangle(file)
{
console.log(file)
console.log(file[0]['Left_coordinate'])
// return;
// let canvas = this.myCanvas.nativeElement;
let canvas = this.canvasRef.nativeElement;
let context = canvas.getContext('2d');
let source = new Image();
source.onload = () =>
{
// context.drawImage(source, 0, 0);
context.drawImage(source, 0, 0, canvas.width, canvas.height);
// context.rect(file.Left_coordinate,file.Top_coordinate,file.Face_width,file.Face_height);
// context.rect(191.34118258953094,55.151419043540955,43.000154942274094,59.001098334789276);
for(let k=0;k<file.length;k++){
console.log(file[k]['Left_coordinate'],file[k]['Top_coordinate'],file[k]['Face_width'],file[k]['Face_height'])
context.rect(file[k]['Left_coordinate'],file[k]['Top_coordinate'],file[k]['Face_width'],file[k]['Face_height']);
this.similarity = file[k]['Similarity'].toString();
console.log('befor',this.similarity)
let atemp = this.similarity.split(".");
this.similarity = atemp[0];
console.log('befor',this.similarity)
// this.similarity = [
// {similarity: 80},
// {similarity: 30}
// ]
// this.similarity = 20
console.log('after',this.similarity)
if (this.similarity <= 60) {
this.color[k] = {'color':'red','value':this.similarity}
// context.strokeStyle = this.color[k]
console.log('red111111',this.color[k],this.similarity <= 30)
}
else if (this.similarity <= 80 && this.similarity > 60) {
this.color[k] = {'color':'orange','value':this.similarity}
// context.strokeStyle = this.color[k]
console.log('orange222222',this.color[k],this.similarity <= 70 && this.similarity > 30)
}
else if (this.similarity > 80) {
this.color[k] = {'color':'green','value':this.similarity}
// context.strokeStyle = this.color[k]
console.log('green33333',this.color[k],this.similarity > 70)
}
console.log(this.color[k])
context.strokeStyle = this.color[k]['color']
context.lineWidth = 2;
context.strokeRect(file[k]['Left_coordinate'],file[k]['Top_coordinate'],file[k]['Face_width'],file[k]['Face_height']);
console.log(context.strokeStyle)
/// lets save current state as we make a lot of changes
// context.save();
/// text color
// get width of text
context.font = "bold 50px Arial";
var width = context.measureText(this.similarity+'%').width;
var height = context.measureText(this.similarity+'%').height;
context.fillStyle = '#ffffff94';
/// draw text on top
let heightValueCode = file[k]['Top_coordinate'] - 10
console.log(heightValueCode)
// context.textAlign = "end";
// context.textAlign = 'center';
context.fillText('\u{2B1B}',file[k]['Left_coordinate'],heightValueCode,width,height);
// ctx.fillText(txt, x, y);
// context.restore();
console.log(file[k]['Top_coordinate'])
let heightValue = file[k]['Top_coordinate'] - 15
console.log(heightValue)
let widthValue = file[k]['Left_coordinate'] + 7
context.fillStyle = this.color[k]['color']
// context.fill();
/// get width of text
// var width = context.measureText(this.similarity+'%').width;
/// draw background rect assuming height of font
// context.fillRect(file[k]['Left_coordinate'],heightValue, width);
// context.fill()
context.font = "bold 20px Arial";
// context.fillText('\u{2B1B}',file[k]['Left_coordinate'],heightValue);
context.fillText(this.similarity+'%',widthValue,heightValue);
// context.globalCompositeOperation = "destination-over";
// context.textAlign = "center";
// this.drawTextBG(context,file[k]['Left_coordinate'],heightValue)
// context.fillStyle = this.color[k];
context.beginPath();
context.stroke();
}
console.log(this.color)
};
source.src = this.aplicantDetails.is_person_met_pic;
}
/// expand with color, background etc.
// drawTextBG(context, x, y) {
// /// lets save current state as we make a lot of changes
// context.save();
// /// text color
// context.fillStyle = '#fff';
// /// draw text on top
// context.fillText('\u{2B1B}',x,y);
// // ctx.fillText(txt, x, y);
// /// restore original state
// context.restore();
// }
// cropImg(val)
// {
// console.log(val)
// // let canvas = this.canvasRef.nativeElement;
// // let canvas = document.getElementById('myCanvas');
// let canvas = this.myCanvas.nativeElement;
// let context = canvas.getContext('2d');
// var image = new Image();
// //image.src = "https://images.unsplash.com/photo-1593642634443-44adaa06623a?ixid=MnwxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=725&q=80";
// // image.src = "https://docs.aws.amazon.com/rekognition/latest/dg/images/face.png";
// image.src = "https://media.istockphoto.com/photos/portrait-of-multi-ethnic-business-couple-picture-id1207862144?k=20&m=1207862144&s=612x612&w=0&h=fckYWdy8jqnq6rOXPgJ5ocKvhErnunAxkGaoG_OunD8=";
// image.onload = function(){
// //orginal value passed here
// // alert('100',Left_coordinate,Top_coordinate,Face_height,Face_width,image_width,image_height)
// for(let k=0;k<val.length;k++){
// context.drawImage(image,val[k]['Left_coordinate'],val[k]['Top_coordinate'],val[k]['Face_width'],val[k]['Face_height'],50,50,val[k]['Face_width'],val[k]['Face_height']);
// }
// // context.drawImage(image,val.Left_coordinate, val.Top_coordinate, val.Face_width, val.Face_height,50, 50, val.Face_width,val.Face_height)
// //maual value
// // context.drawImage(image, 260, 200, 300, 185, 50 ,50 , 120, 180);
// //for rectangle
// // context.fillRect(Left_coordinate, Top_coordinate, Face_width, Face_height);
// //actual formula
// // drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);
// }
// console.log('base64',this.myCanvas)
// this.base64()
// }
// base64(){
// console.log('base64')
// let ba64 = this.aplicantDetails.is_person_met_pic
// this._pd.getBase64ImageFromUrl(ba64).then(
// base64 => {
// console.log(base64)
// this.base64Image = base64
// console.log(this.base64Image)
// console.log('base64')
// this.multiFaceComparsionDetails(this.base64Image)
// })
// }
// multiFaceComparsionDetails(base64Img){
// this.loaderService.showMatSpinnerDialog("Please wait...")
// // this.convertBaseURL(this.aplicantDetails.is_person_met_pic)
// console.log(base64Img)
// base64Img = base64Img.toString();
// let atemp = base64Img.split(",");
// let base64URL = atemp[1];
// console.log('URL',base64URL)
// // let con_base64_URL = base64URL
// // console.log(con_base64_URL)
// let params= {
// "pdid": this.pd_id,
// // "src": this.aplicantDetails.is_person_met_pic,
// // "dest": this.aplicantDetails.is_person_met_id_proof,
// "src": base64URL,
// "dest":this.aplicantDetails.is_person_met_pic,
// "src_url_type": 'base64',
// "dest_url_type":'url'
// }
// console.log(params)
// this._pd.facialComparsionApi(params).subscribe(result => {
// console.log(result)
// return;
// this.rawData = result
// console.log(this.rawData)
// if (result.nxt_action == null) {
// this.faceMatchesDetails = result.FaceMatches
// console.log(this.faceMatchesDetails)
// this.sourceImageFaceDetails = result.SourceImageFace
// console.log(this.sourceImageFaceDetails)
// this.similarity = this.faceMatchesDetails[0].Similarity
// // let splitedValue = this.similarity.split(".")[0];
// // this.similarity = splitedValue
// this.similarity = this.similarity.toString();
// let atemp = this.similarity.split(".");
// this.similarity = atemp[0];
// console.log('befor',this.similarity)
// // this.similarity = 55;
// console.log('after',this.similarity)
// if (this.similarity <= 30) {
// this.color = 'red'
// }
// else if (this.similarity <= 70 && this.similarity > 30) {
// this.color = 'orange'
// }
// else if (this.similarity > 70) {
// this.color = 'green'
// }
// let qty = this.faceMatchesDetails[0].Face
// this.faceDetails = qty.Quality
// console.log(this.faceDetails)
// // console.log(this.faceDetails.Quality)
// }
// }, err => {
// this.loaderService.closeMatSpinnerDialog();
// // this.disableAfterSubmit = false;
// // this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (err.error_type == 2 ? err.error_status + ' ( ' + err.error_text + ' ) ' : ' ( ' + err.error_text + ' ) ') +'\" Error Occur.!');
// });
// this.loaderService.closeMatSpinnerDialog();
// }
// AddFilesToFormData(event: any) {
// console.log(event)
// // if (event.target.files && event.target.files.length) {
// for (const file of event.target.files) {
// const reader = new FileReader();
// reader.readAsDataURL(file);
// reader.onload = () => {
// const img = new Image();
// img.src = reader.result as string;
// img.onload = () => {
// const height = img.naturalHeight;
// const width = img.naturalWidth;
// console.log('Width and Height', width, height);
// };
// };
// }
// // }
// }
/** For Popup Close Button */
onNoClick(): void {
this.dialogRef.close(null);
// this.router.navigate(['/setting/entity/list']);
}
// async getBase64ImageFromUrl(imageUrl) {
// var res = await fetch(imageUrl);
// var blob = await res.blob();
// return new Promise((resolve, reject) => {
// var reader = new FileReader();
// reader.addEventListener("load", function () {
// resolve(reader.result);
// }, false);
// reader.onerror = () => {
// return reject(this);
// };
// reader.readAsDataURL(blob);
// })
// }
// convertBaseURL(event) {
// // let fileList: FileList = event.target.files;
// // if (fileList.length > 0) {
// // const file: File = fileList[0];
// this.baseURL = event;
// this.handleInputChange(event); //turn into base64
// // }
// // else {
// // alert("No file selected");
// // }
// }
// handleInputChange(files) {
// var file = files;
// // var pattern = / image-*/;
// var reader = new FileReader();
// // if (!file.type.match(pattern)) {
// // alert('invalid format');
// // return;
// // }
// reader.onloadend = this._handleReaderLoaded.bind(this);
// reader.readAsDataURL(file);
// }
// _handleReaderLoaded(e) {
// let reader = e.target;
// var base64result = reader.result.substr(reader.result.indexOf(',') + 1);
// //this.imageSrc = base64result;
// // let id = this.currentId;
// this.imageBaseURL = base64result;
// console.log(this.imageBaseURL)
// }
}

View File

@ -0,0 +1,13 @@
import { FacialRecognitionModule } from './facial-recognition.module';
describe('FacialRecognitionModule', () => {
let facialRecognitionModule: FacialRecognitionModule;
beforeEach(() => {
facialRecognitionModule = new FacialRecognitionModule();
});
it('should create an instance', () => {
expect(facialRecognitionModule).toBeTruthy();
});
});

View File

@ -0,0 +1,19 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FacialRecognitionModalComponent } from './facial-recognition-modal/facial-recognition-modal.component';
import { MAT_DATE_LOCALE, DateAdapter, MAT_DATE_FORMATS } from '@angular/material';
import { MomentDateAdapter, MAT_MOMENT_DATE_FORMATS } from '@angular/material-moment-adapter';
@NgModule({
imports: [
CommonModule
],
declarations: [FacialRecognitionModalComponent],
exports: [],
providers: [{provide: MAT_DATE_LOCALE, useValue: 'en-GB'},
{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],
entryComponents: []
})
export class FacialRecognitionModule { }

View File

@ -89,7 +89,7 @@
</ng-container>
<ng-container matColumnDef="course_name">
<mat-header-cell *matHeaderCellDef> </mat-header-cell>
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i"
<mat-cell style="width: 80%;" *matCellDef="let details;let i = index;" [formGroupName]="i"
[style.visibility]="_generalForm.controls.individuals.value[i].qualification == '' || _generalForm.controls.individuals.value[i].qualification == '4' || _generalForm.controls.individuals.value[i].qualification == '6' ? 'hidden':'visible'">
<span class="example-container">
<input matInput placeholder="Qualification Details"
@ -102,7 +102,14 @@
</ng-container>
<ng-container matColumnDef="actions">
<mat-header-cell *matHeaderCellDef> </mat-header-cell>
<mat-cell *matCellDef="let details;let i =index;">
<mat-cell *matCellDef="let details;let i =index;" style="padding-right: 0px !important;">
<div *ngIf="faceApiEnabled != 0">
<button *ngIf="(_generalForm.controls.individuals.value[i].is_person_met_pic != '' && _generalForm.controls.individuals.value[i].is_person_met_id_proof != '') && (_generalForm.controls.individuals.value[i].is_person_met_pic != null && _generalForm.controls.individuals.value[i].is_person_met_id_proof != null)" type="button" class="mr-1 hover-icon" mat-raised-button mat-icon-button (click)="facialRecognition(details)"
matTooltip="Edit" matTooltipPosition="below" >
<mat-icon>face</mat-icon>
</button>
</div>
<button type="button" class="mr-1 hover-icon" mat-raised-button mat-icon-button (click)="editIndividuals(details,i)"
matTooltip="Edit " matTooltipPosition="below" [style.visibility]="_generalForm.controls.individuals.value[i].is_main_applicant == true ? 'hidden':'visible'">
<mat-icon>edit</mat-icon>
@ -112,7 +119,7 @@
matTooltipPosition="below" [style.visibility]="_generalForm.controls.individuals.value[i].is_main_applicant == true ? 'hidden':'visible'">
<mat-icon>delete</mat-icon>
</button>
<div *ngIf="_generalForm.controls.individuals.value[i].is_person_met_pic " >
<div *ngIf="_generalForm.controls.individuals.value[i].is_person_met_pic" >
<img mat-card-avatar
src="{{_generalForm.controls.individuals.value[i].is_person_met_pic}}"
class="ml-0 mt-0 mb-0 mr-2 " ngxViewer>

View File

@ -12,6 +12,7 @@ import { Options } from 'selenium-webdriver/edge';
import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component';
import { ReplaySubject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { FacialRecognitionModalComponent } from '../facial-recognition/facial-recognition-modal/facial-recognition-modal.component';
// import { ImageCropperComponent } from '../dialogue/image-cropper/image-cropper.component';
@Component({
@ -101,6 +102,7 @@ export class GeneralInfoComponent implements OnInit {
public filteredRelationShipList: ReplaySubject<any> = new ReplaySubject<any>(1);
public filteredCompanyRelationShipList: ReplaySubject<any> = new ReplaySubject<any>(1);
lender_short_name: any;
faceApiEnabled: string;
/********************** Declaration Section Ends Here *****************/
@ -126,6 +128,9 @@ export class GeneralInfoComponent implements OnInit {
this.role_id=localStorage.getItem('user_role')
console.log('User Role',this.role_id);
this.image_doc_params={pdid:this.pdid,form_id:this.form_id,company_id:''}
this.faceApiEnabled = localStorage.getItem('is_face_api_enabled')
console.log(this.faceApiEnabled)
}
/********************** Constructor Section Ends Here ****************/
documentsAndFilesList: any = [];
@ -1135,5 +1140,20 @@ salariedcheck(){
this._generalForm.get('is_kyc').updateValueAndValidity()
}
facialRecognition(details): void {
console.log('1140',details.value)
const dialogRef = this.dialog.open(FacialRecognitionModalComponent, {
data: {pdid:this.pdid,aplicantDetails:details.value},
disableClose: true,
minWidth: '70%',
maxWidth: '70%',
height: '80%',
});
dialogRef.afterClosed().subscribe(result => {
console.log('The dialog was closed');
// alert(result);
});
}
}

View File

@ -15,13 +15,15 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { FlexLayoutModule } from '@angular/flex-layout';
import { DynamicQuestionTemplateComponent } from './forms/dynamic-form/dynamic-question-template/dynamic-question-template.component';
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
import { MatIconModule } from '@angular/material';
import { MatIconModule, MatDialogModule } from '@angular/material';
// import { ImageCaptureComponent } from './forms/image-capture/image-capture.component';
// import { CaptureBtnComponent } from './forms/image-capture/capture-btn/capture-btn.component';
// import { Ng2ImgMaxModule } from 'ng2-img-max';
import { NgxViewerModule } from 'ngx-viewer';
import { AnswerOptionCreateDialogComponent } from './forms-dynamic/answer-option-create-dialog/answer-option-create-dialog.component';
import {MatTreeModule} from '@angular/material/tree';
import { FacialRecognitionModule } from './forms/facial-recognition/facial-recognition.module';
import { FacialRecognitionModalComponent } from './forms/facial-recognition/facial-recognition-modal/facial-recognition-modal.component';
// import { QuestionControlComponent } from './forms-dynamic/question-control/question-control.component';
const pdCustomNotifierOptions: NotifierOptions = {
position: {
@ -67,6 +69,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
@NgModule({
imports: [
CommonModule,
FacialRecognitionModule,
StartPdRoutingModule,
SharedModule,
DemoMaterialModule,
@ -79,7 +82,9 @@ const pdCustomNotifierOptions: NotifierOptions = {
MatTreeModule,
NgxViewerModule
],
declarations: [ DynamicFormComponent,DynamicQuestionTemplateComponent],
entryComponents:[]
declarations: [FacialRecognitionModalComponent,DynamicFormComponent,DynamicQuestionTemplateComponent],
exports: [FacialRecognitionModalComponent],
providers: [MatDialogModule],
entryComponents:[FacialRecognitionModalComponent]
})
export class StartPdModule { }

View File

@ -163,6 +163,7 @@ import {
MatTreeModule,
} from '@angular/material';
import { CropToolsComponent } from './list-pd/start-pd/forms/dialogue/crop-tools/crop-tools.component';
import { FacialRecognitionModalComponent } from './list-pd/start-pd/forms/facial-recognition/facial-recognition-modal/facial-recognition-modal.component';
/**
* Custom angular notifier options
*/
@ -208,7 +209,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
};
@NgModule({
declarations: [TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent,VendorPdAllocationComponent, DuplicatePdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent,StartPd2Component, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent,PdCollectedDocsComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe, RupeeCurrencyFormatPipe, NumberToWordsPipe, DeleteRecordsCountPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent, SalesDetailsComponent, DailySalesDetailsComponent, SalesCalculationComponent, ManageSalesComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent ,ManageDailyPurchaseComponent, DailyPurchaseDetailsComponent, ManageRentalVerificationComponent, FuturePlansAndBusinessEnvironmentComponent, ImageCropComponent,CropToolsComponent,PurchaseCalculationComponent,QueriesDocsComponent, ImageDocsComponent,CustomTitleCaseDirective, SpeedDialFabComponent,VideoPlayerComponent,
declarations: [TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent,VendorPdAllocationComponent, DuplicatePdComponent,FacialRecognitionModalComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent,StartPd2Component, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent,PdCollectedDocsComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe, RupeeCurrencyFormatPipe, NumberToWordsPipe, DeleteRecordsCountPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent, SalesDetailsComponent, DailySalesDetailsComponent, SalesCalculationComponent, ManageSalesComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent ,ManageDailyPurchaseComponent, DailyPurchaseDetailsComponent, ManageRentalVerificationComponent, FuturePlansAndBusinessEnvironmentComponent, ImageCropComponent,CropToolsComponent,PurchaseCalculationComponent,QueriesDocsComponent, ImageDocsComponent,CustomTitleCaseDirective, SpeedDialFabComponent,VideoPlayerComponent,
DynamicFormComponent,DynamicQuestionTemplateComponent, ImagesAllComponent,AnswerOptionCreateDialogComponent,FormComponent,FormGroupComponent],
imports: [
CommonModule,
@ -260,12 +261,12 @@ const pdCustomNotifierOptions: NotifierOptions = {
MatVideoModule
],
exports: [DuplicatePdComponent,VendorPdAllocationComponent,PdLocatedMapViewDirective, PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent,StartPd2Component, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent,PdCollectedDocsComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent, BusinessInfoGroupComponent,DailySalesDetailsComponent, SalesCalculationComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent, DailyPurchaseDetailsComponent, ManageDailyPurchaseComponent,ManageRentalVerificationComponent,ImageCropComponent,CropToolsComponent,PurchaseCalculationComponent],
exports: [FacialRecognitionModalComponent,DuplicatePdComponent,VendorPdAllocationComponent,PdLocatedMapViewDirective, PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent,StartPd2Component, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent,PdCollectedDocsComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent, BusinessInfoGroupComponent,DailySalesDetailsComponent, SalesCalculationComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent, DailyPurchaseDetailsComponent, ManageDailyPurchaseComponent,ManageRentalVerificationComponent,ImageCropComponent,CropToolsComponent,PurchaseCalculationComponent],
providers: [PdTrigerService, GetGeometricLocationService,{provide: MAT_DATE_LOCALE, useValue: 'en-GB'},
{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}, PdLocatedMapViewDirective,QuesFormService],
entryComponents: [DuplicatePdComponent,VendorPdAllocationComponent,PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,BusinessAssetsInfoComponent,
entryComponents: [FacialRecognitionModalComponent,DuplicatePdComponent,VendorPdAllocationComponent,PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,BusinessAssetsInfoComponent,
ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent,PdCollectedDocsComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent,BusinessBankingDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, ManageDailySalesComponent,PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent, ManageDailyPurchaseComponent,ManageRentalVerificationComponent,FuturePlansAndBusinessEnvironmentComponent,ImageCropComponent,CropToolsComponent,QueriesDocsComponent,
DynamicFormComponent,DynamicQuestionTemplateComponent,VideoPlayerComponent,ImageDocsComponent,ImagesAllComponent,FormComponent,FormGroupComponent],
})

View File

@ -195,6 +195,13 @@ export class PdTrigerService {
)
}
facialComparsionApi(params): Observable<any>{
return this._http.post<any>(this.apiUrl + "compareFaces",params)
.pipe(
catchError(this.handleError('operation', []))
)
}
// get pd details
getPdDetails(): Observable<any> {
let userrole = localStorage.getItem('user_role')
@ -1195,6 +1202,23 @@ export class PdTrigerService {
generatesateliteimage(param:any): Observable<any>{
return this._http.post<any>(this.apiUrl + 'regenerateSatelliteImg',param )
}
async getBase64ImageFromUrl(imageUrl) {
var res = await fetch(imageUrl);
var blob = await res.blob();
return new Promise((resolve, reject) => {
var reader = new FileReader();
reader.addEventListener("load", function () {
resolve(reader.result);
}, false);
reader.onerror = () => {
return reject(this);
};
reader.readAsDataURL(blob);
})
}
}