All Projects → tancik → Stegastamp

tancik / Stegastamp

Licence: mit
Invisible Hyperlinks in Physical Photographs

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Stegastamp

garden.zbarcam
Migrated to https://github.com/kivy-garden/zbarcam
Stars: ✭ 49 (-83.99%)
Mutual labels:  qrcode, barcode
barcode
No description or website provided.
Stars: ✭ 27 (-91.18%)
Mutual labels:  qrcode, barcode
BarcodeReader
Simple multi-format barcode reader for Windows
Stars: ✭ 26 (-91.5%)
Mutual labels:  qrcode, barcode
android-zbar-sdk
🔗 android-zbar-sdk, provide jni source, so file and jar file used alone, gradle/maven remote dependencies.
Stars: ✭ 311 (+1.63%)
Mutual labels:  qrcode, barcode
barcode scan2
[reborned barcode_scan] A flutter plugin for reading 2D barcodes and QR codes.
Stars: ✭ 43 (-85.95%)
Mutual labels:  qrcode, barcode
barcode-server
Barcode Server for Barcode Client-Server android application
Stars: ✭ 40 (-86.93%)
Mutual labels:  qrcode, barcode
ZxingSupport
A Library based on Zxing, make you easy to develop 1D/2D barcode-scan App.
Stars: ✭ 15 (-95.1%)
Mutual labels:  qrcode, barcode
ZZYQRCode
a scanner for QRCode barCode 最好用的ios二维码、条形码,扫描、生成框架,支持闪光灯,从相册获取,扫描音效等,高仿微信,微博
Stars: ✭ 124 (-59.48%)
Mutual labels:  qrcode, barcode
r scan
📷🖨Flutter二维码&条形码扫描插件,支持相机、文件、链接、Uint8List类型扫描
Stars: ✭ 108 (-64.71%)
Mutual labels:  qrcode, barcode
python
Build Python extension with Dynamsoft Barcode Reader.
Stars: ✭ 35 (-88.56%)
Mutual labels:  qrcode, barcode
javascript-barcode
Dynamsoft Barcode Reader JavaScript SDK for package managers. PDF417, QR Code, DataMatrix, MaxiCode and more are supported.
Stars: ✭ 142 (-53.59%)
Mutual labels:  qrcode, barcode
Swiftscan
A barcode and qr code scanner( 二维码/条形码扫描、生成,仿微信、支付宝)
Stars: ✭ 293 (-4.25%)
Mutual labels:  qrcode, barcode
api2pdf.php
PHP client library for the Api2Pdf.com REST API - Convert HTML to PDF, URL to PDF, Office Docs to PDF, Merge PDFs, HTML to Image, URL to Image, HTML to Docx, HTML to Xlsx, PDF to HTML, Thumbnail preview of office files
Stars: ✭ 42 (-86.27%)
Mutual labels:  qrcode, barcode
react-native-smart-code
Support React & ReactNative.In react-native,it's create base64 String,which is qrcode or barcode ,and without webview.In react,we use jsbarcode.
Stars: ✭ 14 (-95.42%)
Mutual labels:  qrcode, barcode
barcode-detector
Spec compliant polyfill of the Barcode Detection API 🤳
Stars: ✭ 31 (-89.87%)
Mutual labels:  qrcode, barcode
ESCPOS
A ESC/POS Printer Commands Helper
Stars: ✭ 26 (-91.5%)
Mutual labels:  qrcode, barcode
Qrcodereader
Barcode and QR code reader built in Swift
Stars: ✭ 237 (-22.55%)
Mutual labels:  qrcode, barcode
taro-code
Taro Barcode & QRCode
Stars: ✭ 88 (-71.24%)
Mutual labels:  qrcode, barcode
escpos-coffee
Java library for ESC/POS printer
Stars: ✭ 172 (-43.79%)
Mutual labels:  qrcode, barcode
koder
QR/bar code scanner for the Browser
Stars: ✭ 73 (-76.14%)
Mutual labels:  qrcode, barcode

StegaStamp: Invisible Hyperlinks in Physical Photographs [Project Page]

CVPR 2020

Matthew Tancik, Ben Mildenhall, Ren Ng University of California, Berkeley

Introduction

This repository is a code release for the ArXiv report found here. The project explores hiding data in images while maintaining perceptual similarity. Our contribution is the ability to extract the data after the encoded image (StegaStamp) has been printed and photographed with a camera (these steps introduce image corruptions). This repository contains the code and pretrained models to replicate the results shown in the paper. Additionally, the repository contains the code necessary to train the encoder and decoder models.

Citation

If you find our work useful, please consider citing:

    @inproceedings{2019stegastamp,
        title={StegaStamp: Invisible Hyperlinks in Physical Photographs},
        author={Tancik, Matthew and Mildenhall, Ben and Ng, Ren},
        booktitle={IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
        year={2020}
    }

Installation

  • Clone repo and install submodules
git clone --recurse-submodules https://github.com/tancik/StegaStamp.git
cd StegaStamp
  • Install tensorflow (tested with tf 1.13)
  • Python 3 required
  • Download dependencies
pip install -r requirements.txt

Training

Encoder / Decoder

  • Set dataset path in train.py
TRAIN_PATH = DIR_OF_DATASET_IMAGES
  • Train model
bash scripts/base.sh EXP_NAME

The training is performed in train.py. There are a number of hyperparameters, many corresponding to the augmentation parameters. scripts/bash.sh provides a good starting place.

Pretrained network

Run the following in the base directory to download the trained network used in paper:

wget http://people.eecs.berkeley.edu/~tancik/stegastamp/saved_models.tar.xz
tar -xJf saved_models.tar.xz
rm saved_models.tar.xz

Detector

The training code for the detector model (used to segment StegaStamps) is not included in this repo. The model used in the paper was trained using the BiSeNet model released here. CROP_WIDTH and CROP_HEIGHT were set to 1024, all other parameters were set to the default. The dataset was generated by randomly placing warped StegaStamps onto larger images.

The exported detector model can be downloaded with the following command:

wget http://people.eecs.berkeley.edu/~tancik/stegastamp/detector_models.tar.xz
tar -xJf detector_models.tar.xz
rm detector_models.tar.xz

Tensorboard

To visualize the training run the following command and navigate to http://localhost:6006 in your browser.

tensorboard --logdir logs

Encoding a Message

The script encode_image.py can be used to encode a message into an image or a directory of images. The default model expects a utf-8 encoded secret that is <= 7 characters (100 bit message -> 56 bits after ECC).

Encode a message into an image:

python encode_image.py \
  saved_models/stegastamp_pretrained \
  --image test_im.png  \
  --save_dir out/ \
  --secret Hello

This will save both the StegaStamp and the residual that was applied to the original image.

Decoding a Message

The script decode_image.py can be used to decode a message from a StegaStamp.

Example usage:

python decode_image.py \
  saved_models/stegastamp_pretrained \
  --image out/test_hidden.png

Detecting and Decoding

The script detector.py can be used to detect and decode StegaStamps in an image. This is useful in cases where there are multiple StegaStamps are present or the StegaStamp does not fill the frame of the image.

To use the detector, make sure to download the detector model as described in the installation section. The recomended input video resolution is 1920x1080.

python detector.py \
  --detector_model detector_models/stegastamp_detector \
  --decoder_model saved_models/stegastamp_pretrained \
  --video test_vid.mp4

Add the --save_video FILENAME flag to save out the results.

The --visualize_detector flag can be used to visualize the output of the detector network. The mask corresponds to the segmentation mask, the colored polygons are fit to this segmentation mask using a set of heuristics. The detector outputs can noisy and are sensitive to size of the stegastamp. Further optimization of the detection network is not explored in this paper.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].