Comparing version 0.1.1 to 0.1.2
@@ -146,7 +146,7 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.alanView = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
AlanView.prototype.drawFaces = function(context, faces, scale) { | ||
var face, height, j, len, results, width, x, y; | ||
var confidence, face, height, j, len, results, width, x, y; | ||
results = []; | ||
for (j = 0, len = faces.length; j < len; j++) { | ||
face = faces[j]; | ||
x = face.x, y = face.y, width = face.width, height = face.height; | ||
x = face.x, y = face.y, width = face.width, height = face.height, confidence = face.confidence; | ||
x *= scale; | ||
@@ -159,3 +159,9 @@ y *= scale; | ||
context.strokeStyle = 'rgba(0, 0, 155, 0.9)'; | ||
results.push(context.strokeRect(x, y, width, height)); | ||
context.strokeRect(x, y, width, height); | ||
if (this.props.noFaceConfidence == null) { | ||
context.fillStyle = 'rgba(255, 255, 255, 1.0)'; | ||
results.push(context.fillText(confidence.toFixed(2), x, y + height + 10)); | ||
} else { | ||
results.push(void 0); | ||
} | ||
} | ||
@@ -162,0 +168,0 @@ return results; |
{ | ||
"name": "alan-view", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Alan's view for a given image", | ||
@@ -5,0 +5,0 @@ "licenses": [ |
@@ -56,2 +56,3 @@ # (WIP) Alan's View | ||
- `noFaces`: hides faces bounding boxes | ||
- `noFaceConfidence`: hide confidence levels for faces | ||
- `noScene`: hides scene bounding box | ||
@@ -72,1 +73,2 @@ - `noSceneFading`: hides the fading bounding box around scene | ||
- Lines (columns/rows): red bounding boxes around scene region | ||
- Faces: blue bounding boxes around each face |
Sorry, the diff of this file is not supported yet
17776
220
73