معرفی شرکت ها


deepapi-0.4.2


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

Deep Learning as a Cloud API Service.
ویژگی مقدار
سیستم عامل -
نام فایل deepapi-0.4.2
نام deepapi
نسخه کتابخانه 0.4.2
نگهدارنده ['wuhanstudio']
ایمیل نگهدارنده ['wuhanstudio <wuhanstudios@gmail.com>']
نویسنده wuhanstudio
ایمیل نویسنده wuhanstudio <wuhanstudios@gmail.com>
آدرس صفحه اصلی https://github.com/wuhanstudio/deepapi
آدرس اینترنتی https://pypi.org/project/deepapi/
مجوز MIT License
## Deep API > Deep Learning as Cloud APIs. This project provides an image classification cloud service for research on **Black-box Adversarial Attacks**. ![](demo.gif) ### Quick Start #### Using Docker: ``` docker run -p 8080:8080 wuhanstudio/deepapi ``` #### Python 3: ``` $ pip install deepapi # By default, we enable all models on the server. # Use deepapi -h to see more options. $ python -m deepapi Serving on port 8080... ``` The website and API service are available at https://localhost:8080. ### DeepAPI Client To initiate **black-box adversarial attacks**, we can get predictions by sending a POST request to http://localhost:8080/vgg16_cifar10 without knowing details about deep learning models behind the cloud service. ``` import numpy as np from PIL import Image from deepapi.api import DeepAPI_VGG16_Cifar10 # Load the image x = Image.open("dog.jpg") x = np.array(x) # Initialize the model model = DeepAPI_VGG16_Cifar10('http://localhost:8080', concurrency=8) # Predict y = model.predict(np.array([x]))[0] # Print the result model.print(y) ``` </details> <details> <summary><h3> Using Curl</h3></summary> ``` export IMAGE_FILE=test/cat.jpg (echo -n '{"file": "'; base64 $IMAGE_FILE; echo '"}') | \ curl -H "Content-Type: application/json" \ -d @- http://127.0.0.1:8080/vgg16_cifar10 ``` </details> <details> <summary><h3> Using Python Request</h3></summary> You can also implement the API client from scratch using the request module. ``` def classification(url, file): # Load the input image and construct the payload for the request image = Image.open(file) buff = BytesIO() image.save(buff, format="JPEG") data = {'file': base64.b64encode(buff.getvalue()).decode("utf-8")} return requests.post(url, json=data).json() res = classification('http://127.0.0.1:8080/vgg16_cifar10', 'cat.jpg') ``` This python script is available in the `test` folder. You should see prediction results by running `python3 minimal.py`: ``` cat 0.99804 deer 0.00156 truck 0.00012 airplane 0.00010 dog 0.00009 bird 0.00005 ship 0.00003 frog 0.00001 horse 0.00001 automobile 0.00001 ``` #### Concurrent requests Sending 5 concurrent requests to the API server: ``` $ python3 multi-client.py --num_workers 5 cat.jpg ``` You should see the result: ``` ----- start ----- Sending requests Sending requests Sending requests Sending requests Sending requests ------ end ------ Concurrent Requests: 5 Total Runtime: 2.441638708114624 ```


نیازمندی

مقدار نام
>=61.0 setuptools
- flask
- waitress
- grpcio
- h5py
- keras
- keras-preprocessing
- numpy
- pillow
- requests
- tensorflow


زبان مورد نیاز

مقدار نام
>=3.6 Python


نحوه نصب


نصب پکیج whl deepapi-0.4.2:

    pip install deepapi-0.4.2.whl


نصب پکیج tar.gz deepapi-0.4.2:

    pip install deepapi-0.4.2.tar.gz