equalais_app

所属分类:开发工具
开发工具:Python
文件大小:0KB
下载次数:0
上传日期:2021-02-24 18:43:07
上 传 者sh-1993
说明:  equalAIs是一个项目,始于哈佛大学伯克曼·克莱恩中心(Berkman Klein Center)和麻省理工学院医学院(MIT Med)2018年大会计划的一部分...,
(equalAIs is a project that began as a part of the 2018 Assembly program at the Berkman Klein Center at Harvard University and the MIT Media Lab. This repository provides the code for running and deploying the equalAIs tool, including the adversarial attack model, the steganographic message encoding, and the visible watermark. https://equalais.me...)

文件列表:
equalais_app-development/ (0, 2021-02-24)
equalais_app-development/.dockerignore (11, 2021-02-24)
equalais_app-development/.flake8 (152, 2021-02-24)
equalais_app-development/.isort.cfg (112, 2021-02-24)
equalais_app-development/.pre-commit-config.yaml (492, 2021-02-24)
equalais_app-development/Dockerfile (437, 2021-02-24)
equalais_app-development/equalAIs_watermark.png (21223, 2021-02-24)
equalais_app-development/gcp_rest_app.yaml (127, 2021-02-24)
equalais_app-development/main.py (3547, 2021-02-24)
equalais_app-development/model/ (0, 2021-02-24)
equalais_app-development/model/checkpoint (77, 2021-02-24)
equalais_app-development/model/model.ckpt.data-00000-of-00001 (9555384, 2021-02-24)
equalais_app-development/model/model.ckpt.index (534, 2021-02-24)
equalais_app-development/model/model.ckpt.meta (105210, 2021-02-24)
equalais_app-development/requirements.txt (306, 2021-02-24)
equalais_app-development/requirements_development.txt (60, 2021-02-24)
equalais_app-development/scripts/ (0, 2021-02-24)
equalais_app-development/scripts/black.sh (433, 2021-02-24)
equalais_app-development/scripts/flake8.sh (279, 2021-02-24)
equalais_app-development/scripts/isort.sh (429, 2021-02-24)
equalais_app-development/src/ (0, 2021-02-24)
equalais_app-development/src/__init__.py (0, 2021-02-24)
equalais_app-development/src/adversarial_attack/ (0, 2021-02-24)
equalais_app-development/src/adversarial_attack/__init__.py (0, 2021-02-24)
equalais_app-development/src/adversarial_attack/__main__.py (2152, 2021-02-24)
equalais_app-development/src/io.py (1151, 2021-02-24)
equalais_app-development/src/logger.py (1818, 2021-02-24)
equalais_app-development/src/steganography/ (0, 2021-02-24)
equalais_app-development/src/steganography/__init__.py (0, 2021-02-24)
equalais_app-development/src/steganography/__main__.py (6676, 2021-02-24)
equalais_app-development/src/tests/ (0, 2021-02-24)
equalais_app-development/src/tests/functional/ (0, 2021-02-24)
equalais_app-development/src/tests/functional/test_steganography.py (1162, 2021-02-24)
equalais_app-development/src/watermark/ (0, 2021-02-24)
equalais_app-development/src/watermark/__init__.py (0, 2021-02-24)
equalais_app-development/src/watermark/__main__.py (3076, 2021-02-24)

# equalAIs app The equalAIs app provides three levels of protection and control to an image: | | | |-|-| | | 1. Adversial attack against face recognition
2. Stegnographic message encoding
3. Visible watermark | ||| Current REST API: `https://equalais.ue.r.appspot.com` ## Spinning up REST service ### On Google Cloud App Engine 1. Install/configurature [google cloud SDK](https://cloud.google.com/sdk/) 1. In your Google Cloud dashboard create a project, `{gcloud-project-name}` 1. In a terminal, run: ```bash gcloud app deploy gcp_rest_app.yaml --project {gcloud-project-name} --verbosity=info ``` 1. Update the URL in `equalais.github.io/js/tool.js` to be URL defined in the console output from the above command. ### Locally 1. Build the Docker image: ```bash docker build . -t {equalais-image-name} ``` 1. Spin up the container: ```bash docker run -p 127.0.0.1:8080:8080 {equalais-image-name} ``` 1. Then update the URL in `equalais.github.io/js/tool.js` to be `http://0.0.0.0:8080`. ## Running equalAIs components manually In order to run components of equalAIs manually (i.e., not using the hosted tool), you will need to clone this repository. We do not currently provide a script for running the adversarial attack manually. For details on implementation and argument options, please see the Python scripts in src. ### Steganography The equalAIs webtool uses the following by default: - `--message`: `I do not consent to use of face detection on this image or derivatives of this image.` - `--token`: `elephant_garlic_pizza` We are planning on updating our API to allow users to define their own message and decode token, however this is not currently available. In the meantime you can customize your steganographic message and token by running the steganography script manually. #### Manually encoding steganographic message If you would like to use a custom message and decoding token, you can run the steganography script using the following command in the root of this project: ```bash python -m src.steganography encode path/to/photo.png --message "your-custom-message" --token "your-special-token" ``` #### Decoding steganographic message You can decode your image that has been run through the equalAIs tool by running the following command in the root of this project: ```bash python -m src.steganography decode "path/to/equalais/photo.png" --token "elephant_garlic_pizza" ``` If your image has been run through the webtool, by default this should return the message: > I do not consent to use of face detection on this image or derivatives of this image. #### Method We use the Least Significant Bit (LSB) technique. The implementation we use is heavily based off of [Abdou Rockikz's well-explained demonstration](https://www.thepythoncode.com/article/hide-secret-data-in-images-using-steganography-python). Please note that a limitation of the LSB technique is that it only works on lossless compression images. As a result, we only write our images as `.png` files. Our tool is a proof-of-concept, and we welcome suggestions and pull-request contributions for more robust techniques! ### Watermark You can also manually add a watermark to an image using the following command: ```bash python -m src.watermark "path/to/photo.png" ```

近期下载者

相关文件


收藏者