Skip to content

Instantly share code, notes, and snippets.

@banujan6
Created June 13, 2021 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save banujan6/41422a1118954cc294a9b4251cfbe672 to your computer and use it in GitHub Desktop.
Save banujan6/41422a1118954cc294a9b4251cfbe672 to your computer and use it in GitHub Desktop.
azure cognitive services + angular
<div class="container">
<div style="padding-bottom: 40px;" *ngIf="imageRawString !== null">
<div
class="object-marker"
*ngFor="let objectData of objects"
[ngStyle]="{
'margin-left.px': objectData.rectangle.x / image.ratio,
'margin-top.px': objectData.rectangle.y / image.ratio,
'width.px': objectData.rectangle.w / image.ratio,
'height.px': objectData.rectangle.h / image.ratio
}"
>
<label style="background-color: red;">{{ objectData.object }}</label>
</div>
<img src="{{ imageRawString }}" [ngStyle]="{'width.px': image.fixedWidth}"/>
</div>
<input type="file" style="display: none;" accept="image/*" (change)="readImage($event.target)" #uploadFile>
<button *ngIf="!isAnalysing" class="upload-btn" (click)="openImageBrowseDialog()">Select an Image</button>
<h2 *ngIf="isAnalysing">Analysing Image.... Please Wait!</h2>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment