This file contains hidden or 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 os | |
import time | |
import segmentation_models as sm | |
# Segmentation Models: using `keras` framework. | |
import tensorflow as tf | |
from tensorflow.python.client import device_lib | |
from config import cfg |
This file contains hidden or 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 time import sleep | |
from json import dumps | |
from kafka import KafkaProducer | |
BPS_models = '/home/vybt/Downloads/release_official/full_flow_test/models.txt' | |
producer = KafkaProducer(bootstrap_servers=['localhost:9092'], | |
value_serializer=lambda x: | |
dumps(x).encode('utf-8')) |
This file contains hidden or 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 logging | |
log = logging.getLogger(__name__) | |
from smart_fashion_client.api.request_util import extract_extension_for_key | |
from smart_fashion_client.s3_upload import helpers | |
# | |
from smart_fashion_client.api.body_parts_segmentation.logic.body_parts_segmentation import human_parsing_processing | |
from json import dumps | |
from kafka import KafkaProducer |
This file contains hidden or 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
1 | |
after infer parsing: 1.249729871749878 | |
/usr/local/lib/python3.6/dist-packages/tensorflow_serving/apis/prediction_service_pb2.py:131: DeprecationWarning: beta_create_PredictionService_stub() method is deprecated. This method will be removed in near future versions of TF Serving. Please switch to GA gRPC API in prediction_service_pb2_grpc. | |
'prediction_service_pb2_grpc.', DeprecationWarning) | |
/usr/local/lib/python3.6/dist-packages/tensorflow_serving/apis/prediction_service_pb2.py:131: DeprecationWarning: beta_create_PredictionService_stub() method is deprecated. This method will be removed in near future versions of TF Serving. Please switch to GA gRPC API in prediction_service_pb2_grpc. | |
'prediction_service_pb2_grpc.', DeprecationWarning) | |
total time module 2: 4.909551382064819 | |
end time: 6.159325838088989 | |
2 | |
after infer parsing: 1.223271131515503 |
This file contains hidden or 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
handling https://bap-fashion-shop.s3.amazonaws.com/11.jpg | |
for 1 | |
End time for Body parts segmentation: 0.9372918605804443 | |
[{'ownerId': 1, 'combineFeaturesURL': 'https://bap-fashion-shop.s3.amazonaws.com/user_id_1_combine_features_111586408310.png', 'schpURL': 'https://bap-fashion-shop.s3.amazonaws.com/user_id_1_SCHP_111586408311.png'}] | |
sending message [{'ownerId': 1, 'combineFeaturesURL': 'https://bap-fashion-shop.s3.amazonaws.com/user_id_1_combine_features_111586408310.png', 'schpURL': 'https://bap-fashion-shop.s3.amazonaws.com/user_id_1_SCHP_111586408311.png'}] out to: bpsOut | |
handling https://bap-fashion-shop.s3.amazonaws.com/womna_3.jpeg | |
for 2 | |
End time for Body parts segmentation: 0.7253215312957764 | |
[{'ownerId': 2, 'combineFeaturesURL': 'https://bap-fashion-shop.s3.amazonaws.com/user_id_2_combine_features_womna_31586408312.png', 'schpURL': 'https://bap-fashion-shop.s3.amazonaws.com/user_id_2_SCHP_womna_31586408312.png'}] | |
sending message [{'ownerId': 2, 'combineFeaturesURL': 'https://bap-fashion-shop.s3.am |
This file contains hidden or 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 logging | |
log = logging.getLogger(__name__) | |
from api.request_util import extract_extension_for_key, get_kafka_comsumer | |
from s3_upload import helpers | |
from api.restplus import api | |
from api.body_parts_segmentation.logic.body_parts_segmentation import human_parsing_processing | |
from flask import request, jsonify | |
from flask_restplus import Resource |
This file contains hidden or 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 __future__ import absolute_import, division, print_function, unicode_literals | |
import logging.config | |
import tensorflow as tf | |
import os | |
import numpy as np | |
from tensorflow import ConfigProto | |
from argument_parse import args | |
from module.discriminator_vgg19 import Discriminator |
This file contains hidden or 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 os | |
import cv2 | |
original_image_path = '/home/vybt/Downloads/olk/rmbg_tiennv3/tiennv3_rmbg' | |
resize_padding_output = '/home/vybt/Downloads/olk/rmbg_tiennv3/deep_lab_tiennv3_resize_lookbook' | |
where_to_resize_from = '/home/vybt/Downloads/olk/rmbg_tiennv3/deep_lab_tiennv3_lookbook' | |
def resize_and_padding(im, desired_size): | |
""" |
This file contains hidden or 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
""" | |
Example TensorFlow script for finetuning a VGG model on your own data. | |
Uses tf.contrib.data module which is in release v1.2 | |
Based on PyTorch example from Justin Johnson | |
(https://gist.github.com/jcjohnson/6e41e8512c17eae5da50aebef3378a4c) | |
Required packages: tensorflow (v1.2) | |
Download the weights trained on ImageNet for VGG: | |
``` | |
wget http://download.tensorflow.org/models/vgg_16_2016_08_28.tar.gz |
This file contains hidden or 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
""" | |
Example TensorFlow script for finetuning a VGG model on your own data. | |
Uses tf.contrib.data module which is in release v1.2 | |
Based on PyTorch example from Justin Johnson | |
(https://gist.github.com/jcjohnson/6e41e8512c17eae5da50aebef3378a4c) | |
Required packages: tensorflow (v1.2) | |
Download the weights trained on ImageNet for VGG: | |
``` | |
wget http://download.tensorflow.org/models/vgg_16_2016_08_28.tar.gz |