Upgrade numpy to 1.15.4 (#18506)
This commit is contained in:
parent
9f51deb1de
commit
30806fa362
6 changed files with 39 additions and 41 deletions
|
@ -22,7 +22,7 @@ from homeassistant.helpers.entity import generate_entity_id
|
|||
from homeassistant.helpers.event import async_track_state_change
|
||||
from homeassistant.util import utcnow
|
||||
|
||||
REQUIREMENTS = ['numpy==1.15.3']
|
||||
REQUIREMENTS = ['numpy==1.15.4']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ from homeassistant.components.image_processing import (
|
|||
from homeassistant.core import split_entity_id
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
REQUIREMENTS = ['numpy==1.15.3']
|
||||
REQUIREMENTS = ['numpy==1.15.4']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
"""
|
||||
Component that performs TensorFlow classification on images.
|
||||
Support for performing TensorFlow classification on images.
|
||||
|
||||
For a quick start, pick a pre-trained COCO model from:
|
||||
https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md
|
||||
|
@ -8,8 +8,8 @@ For more details about this platform, please refer to the documentation at
|
|||
https://home-assistant.io/components/image_processing.tensorflow/
|
||||
"""
|
||||
import logging
|
||||
import sys
|
||||
import os
|
||||
import sys
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
|
@ -20,7 +20,7 @@ from homeassistant.core import split_entity_id
|
|||
from homeassistant.helpers import template
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
REQUIREMENTS = ['numpy==1.15.3', 'pillow==5.2.0', 'protobuf==3.6.1']
|
||||
REQUIREMENTS = ['numpy==1.15.4', 'pillow==5.2.0', 'protobuf==3.6.1']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -28,29 +28,29 @@ ATTR_MATCHES = 'matches'
|
|||
ATTR_SUMMARY = 'summary'
|
||||
ATTR_TOTAL_MATCHES = 'total_matches'
|
||||
|
||||
CONF_FILE_OUT = 'file_out'
|
||||
CONF_MODEL = 'model'
|
||||
CONF_GRAPH = 'graph'
|
||||
CONF_LABELS = 'labels'
|
||||
CONF_MODEL_DIR = 'model_dir'
|
||||
CONF_AREA = 'area'
|
||||
CONF_BOTTOM = 'bottom'
|
||||
CONF_CATEGORIES = 'categories'
|
||||
CONF_CATEGORY = 'category'
|
||||
CONF_AREA = 'area'
|
||||
CONF_TOP = 'top'
|
||||
CONF_FILE_OUT = 'file_out'
|
||||
CONF_GRAPH = 'graph'
|
||||
CONF_LABELS = 'labels'
|
||||
CONF_LEFT = 'left'
|
||||
CONF_BOTTOM = 'bottom'
|
||||
CONF_MODEL = 'model'
|
||||
CONF_MODEL_DIR = 'model_dir'
|
||||
CONF_RIGHT = 'right'
|
||||
CONF_TOP = 'top'
|
||||
|
||||
AREA_SCHEMA = vol.Schema({
|
||||
vol.Optional(CONF_TOP, default=0): cv.small_float,
|
||||
vol.Optional(CONF_LEFT, default=0): cv.small_float,
|
||||
vol.Optional(CONF_BOTTOM, default=1): cv.small_float,
|
||||
vol.Optional(CONF_RIGHT, default=1): cv.small_float
|
||||
vol.Optional(CONF_LEFT, default=0): cv.small_float,
|
||||
vol.Optional(CONF_RIGHT, default=1): cv.small_float,
|
||||
vol.Optional(CONF_TOP, default=0): cv.small_float,
|
||||
})
|
||||
|
||||
CATEGORY_SCHEMA = vol.Schema({
|
||||
vol.Required(CONF_CATEGORY): cv.string,
|
||||
vol.Optional(CONF_AREA): AREA_SCHEMA
|
||||
vol.Optional(CONF_AREA): AREA_SCHEMA,
|
||||
})
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
|
@ -58,14 +58,11 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
|||
vol.All(cv.ensure_list, [cv.template]),
|
||||
vol.Required(CONF_MODEL): vol.Schema({
|
||||
vol.Required(CONF_GRAPH): cv.isfile,
|
||||
vol.Optional(CONF_LABELS): cv.isfile,
|
||||
vol.Optional(CONF_MODEL_DIR): cv.isdir,
|
||||
vol.Optional(CONF_AREA): AREA_SCHEMA,
|
||||
vol.Optional(CONF_CATEGORIES, default=[]):
|
||||
vol.All(cv.ensure_list, [vol.Any(
|
||||
cv.string,
|
||||
CATEGORY_SCHEMA
|
||||
)])
|
||||
vol.All(cv.ensure_list, [vol.Any(cv.string, CATEGORY_SCHEMA)]),
|
||||
vol.Optional(CONF_LABELS): cv.isfile,
|
||||
vol.Optional(CONF_MODEL_DIR): cv.isdir,
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -93,7 +90,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||
|
||||
# Make sure locations exist
|
||||
if not os.path.isdir(model_dir) or not os.path.exists(labels):
|
||||
_LOGGER.error("Unable to locate tensorflow models or label map.")
|
||||
_LOGGER.error("Unable to locate tensorflow models or label map")
|
||||
return
|
||||
|
||||
# append custom model path to sys.path
|
||||
|
@ -118,9 +115,9 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||
# pylint: disable=unused-import,unused-variable
|
||||
import cv2 # noqa
|
||||
except ImportError:
|
||||
_LOGGER.warning("No OpenCV library found. "
|
||||
"TensorFlow will process image with "
|
||||
"PIL at reduced resolution.")
|
||||
_LOGGER.warning(
|
||||
"No OpenCV library found. TensorFlow will process image with "
|
||||
"PIL at reduced resolution")
|
||||
|
||||
# setup tensorflow graph, session, and label map to pass to processor
|
||||
# pylint: disable=no-member
|
||||
|
@ -241,23 +238,23 @@ class TensorFlowImageProcessor(ImageProcessingEntity):
|
|||
# Draw custom global region/area
|
||||
if self._area != [0, 0, 1, 1]:
|
||||
draw_box(draw, self._area,
|
||||
img_width, img_height,
|
||||
"Detection Area", (0, 255, 255))
|
||||
img_width, img_height, "Detection Area", (0, 255, 255))
|
||||
|
||||
for category, values in matches.items():
|
||||
# Draw custom category regions/areas
|
||||
if (category in self._category_areas
|
||||
and self._category_areas[category] != [0, 0, 1, 1]):
|
||||
label = "{} Detection Area".format(category.capitalize())
|
||||
draw_box(draw, self._category_areas[category], img_width,
|
||||
img_height, label, (0, 255, 0))
|
||||
draw_box(
|
||||
draw, self._category_areas[category], img_width,
|
||||
img_height, label, (0, 255, 0))
|
||||
|
||||
# Draw detected objects
|
||||
for instance in values:
|
||||
label = "{0} {1:.1f}%".format(category, instance['score'])
|
||||
draw_box(draw, instance['box'],
|
||||
img_width, img_height,
|
||||
label, (255, 255, 0))
|
||||
draw_box(
|
||||
draw, instance['box'], img_width, img_height, label,
|
||||
(255, 255, 0))
|
||||
|
||||
for path in paths:
|
||||
_LOGGER.info("Saving results image to %s", path)
|
||||
|
|
|
@ -4,21 +4,22 @@ Support for Pollen.com allergen and cold/flu sensors.
|
|||
For more details about this platform, please refer to the documentation at
|
||||
https://home-assistant.io/components/sensor.pollen/
|
||||
"""
|
||||
import logging
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
from statistics import mean
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import (
|
||||
ATTR_ATTRIBUTION, ATTR_STATE, CONF_MONITORED_CONDITIONS)
|
||||
from homeassistant.helpers import aiohttp_client
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.util import Throttle
|
||||
|
||||
REQUIREMENTS = ['numpy==1.15.3', 'pypollencom==2.2.2']
|
||||
REQUIREMENTS = ['numpy==1.15.4', 'pypollencom==2.2.2']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
ATTR_ALLERGEN_AMOUNT = 'allergen_amount'
|
||||
|
@ -401,8 +402,8 @@ class PollenComData:
|
|||
await self._get_data(
|
||||
self._client.disease.extended, TYPE_DISEASE_FORECAST)
|
||||
|
||||
_LOGGER.debug('New data retrieved: %s', self.data)
|
||||
_LOGGER.debug("New data retrieved: %s", self.data)
|
||||
except InvalidZipError:
|
||||
_LOGGER.error(
|
||||
'Cannot retrieve data for ZIP code: %s', self._client.zip_code)
|
||||
"Cannot retrieve data for ZIP code: %s", self._client.zip_code)
|
||||
self.data = {}
|
||||
|
|
|
@ -686,7 +686,7 @@ nuheat==0.3.0
|
|||
# homeassistant.components.image_processing.opencv
|
||||
# homeassistant.components.image_processing.tensorflow
|
||||
# homeassistant.components.sensor.pollen
|
||||
numpy==1.15.3
|
||||
numpy==1.15.4
|
||||
|
||||
# homeassistant.components.google
|
||||
oauth2client==4.0.0
|
||||
|
|
|
@ -123,7 +123,7 @@ mficlient==0.3.0
|
|||
# homeassistant.components.image_processing.opencv
|
||||
# homeassistant.components.image_processing.tensorflow
|
||||
# homeassistant.components.sensor.pollen
|
||||
numpy==1.15.3
|
||||
numpy==1.15.4
|
||||
|
||||
# homeassistant.components.mqtt
|
||||
# homeassistant.components.shiftr
|
||||
|
|
Loading…
Add table
Reference in a new issue