{"id":16562807,"url":"https://github.com/charmve/stegastamp-plus","last_synced_at":"2025-07-08T04:05:31.410Z","repository":{"id":106310209,"uuid":"331936397","full_name":"Charmve/StegaStamp-plus","owner":"Charmve","description":"Improved the original repo, 'Invisible Hyperlinks in Physical Photographs', embedded with longer string than the original ","archived":false,"fork":false,"pushed_at":"2024-05-27T02:44:16.000Z","size":382,"stargazers_count":35,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-01T09:33:10.233Z","etag":null,"topics":["barcode","computer-vision","detector","embedding","encoder","encoder-decoder","encryption","image-processing","qrcode","steganography","tensorflow","watermark"],"latest_commit_sha":null,"homepage":"https://github.com/Charmve","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Charmve.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-01-22T12:14:04.000Z","updated_at":"2025-05-21T10:58:58.000Z","dependencies_parsed_at":"2025-04-21T15:32:11.416Z","dependency_job_id":null,"html_url":"https://github.com/Charmve/StegaStamp-plus","commit_stats":{"total_commits":31,"total_committers":1,"mean_commits":31.0,"dds":0.0,"last_synced_commit":"7eb87b739655e9bdaa84a6f09cce560480e2c619"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Charmve/StegaStamp-plus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Charmve%2FStegaStamp-plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Charmve%2FStegaStamp-plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Charmve%2FStegaStamp-plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Charmve%2FStegaStamp-plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Charmve","download_url":"https://codeload.github.com/Charmve/StegaStamp-plus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Charmve%2FStegaStamp-plus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264192282,"owners_count":23570749,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["barcode","computer-vision","detector","embedding","encoder","encoder-decoder","encryption","image-processing","qrcode","steganography","tensorflow","watermark"],"created_at":"2024-10-11T20:37:14.746Z","updated_at":"2025-07-08T04:05:31.391Z","avatar_url":"https://github.com/Charmve.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003ca href=\"https://colab.research.google.com/github/Charmve/StegaStamp/blob/master/StegaStamp_train_model.ipynb\"\u003e\u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" align=\"center\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# StegaStamp-plus\n\u003e A good exploit is one that is delivered in style.  -- Saumil Shah\n\nImproved the original repo, \u003ci\u003eInvisible Hyperlinks in Physical Photographs\u003c/i\u003e @tancik, which without datasets and training parameters.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"profile.png\" alt=\"Folders in Ubuntu\"\u003e\n\u003c/p\u003e\n\n## Features\n\n- Improved training processing;\n- Discovered training super-patrameters;\n- Provided available training datasets;\n- Shell scripts was organized instead of Python;\n\n## Special Acknowledgement\n\nThe original author @[tancik](https://github.com/tancik).\n\n## StegaStamp\n\n\u003e ## StegaStamp: Invisible Hyperlinks in Physical Photographs (CVPR 2020) [[Project Page]](http://www.matthewtancik.com/stegastamp)\n\u003e **[Matthew Tancik](https://www.matthewtancik.com), [Ben Mildenhall](http://people.eecs.berkeley.edu/~bmild/), [Ren Ng](https://scholar.google.com/citations?hl=en\u0026user=6H0mhLUAAAAJ)**\n*University of California, Berkeley*\n\u003e ![](https://github.com/tancik/StegaStamp/blob/master/docs/teaser.png)\n\n\n## Introduction\nThis repository is a code release for the ArXiv report found [here](https://arxiv.org/abs/1904.05343). 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.\n\n\u003ch2 class=\"grey-heading\"\u003eMethod\u003c/h2\u003e\n\u003ch3 class=\"sub_heading\"\u003eDeployment\u003c/h3\u003e\n\u003cdiv\u003e\n\t\u003cdiv class=\"div-block-5\"\u003e\n\t\u003cimg src=\"https://uploads-ssl.webflow.com/51e0d73d83d06baa7a00000f/5ca3b3c3ca205d53d7e986a1_pipeline-01.png\" sizes=\"(max-width: 767px) 90vw, (max-width: 991px) 728px, 940px\" srcset=\"https://uploads-ssl.webflow.com/51e0d73d83d06baa7a00000f/5ca3b3c3ca205d53d7e986a1_pipeline-01-p-500.png 500w, https://uploads-ssl.webflow.com/51e0d73d83d06baa7a00000f/5ca3b3c3ca205d53d7e986a1_pipeline-01-p-800.png 800w, https://uploads-ssl.webflow.com/51e0d73d83d06baa7a00000f/5ca3b3c3ca205d53d7e986a1_pipeline-01-p-1080.png 1080w, https://uploads-ssl.webflow.com/51e0d73d83d06baa7a00000f/5ca3b3c3ca205d53d7e986a1_pipeline-01-p-1600.png 1600w, https://uploads-ssl.webflow.com/51e0d73d83d06baa7a00000f/5ca3b3c3ca205d53d7e986a1_pipeline-01-p-2000.png 2000w, https://uploads-ssl.webflow.com/51e0d73d83d06baa7a00000f/5ca3b3c3ca205d53d7e986a1_pipeline-01.png 2407w\" alt=\"\" class=\"stega_pipeline_img\"/\u003e\n\t\u003c/div\u003e\n\t\u003cp class=\"paragraph-3 stega_text\"\u003eOur system uses an encoder network to process the input image and hyperlink bitstring into a StegaStamp. The StegaStamp is then printed and captured by a camera. A detection network localizes and rectifies the StegaStamp before passing it to the decoder network. After the bits are recovered and error corrected, the user can follow the hyperlink.\u003c/p\u003e\n\u003c/div\u003e\n\n\u003ch3 class=\"sub_heading\"\u003eTraining\u003c/h3\u003e\n\u003cdiv\u003e\n\u003cp class=\"paragraph-3 stega_text\"\u003e To train the encoder and decoder networks, we simulate the corruptions caused by printing, reimaging, and detecting the StegaStamp with a set of differentiable image augmentations.\u003c/p\u003e\n\u003c/div\u003e\n\n## Installation\n- Clone repo and install submodules\n```bash=\ngit clone --recurse-submodules https://github.com/tancik/StegaStamp.git\ncd StegaStamp\n```\n- Install tensorflow (tested with tf 1.13)\n- Python 3 required\n- Download dependencies\n```bash=\npip install -r requirements.txt\n```\n\n## Training\n### Encoder / Decoder\n- Set dataset path in train.py\n```\nTRAIN_PATH = DIR_OF_DATASET_IMAGES\n```\n\n- Train model\n```bash=\nbash scripts/base.sh EXP_NAME\n```\nThe 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.\n\n#### Pretrained network\nRun the following in the base directory to download the trained network used in paper:\n```bash=\nwget http://people.eecs.berkeley.edu/~tancik/stegastamp/saved_models.tar.xz\ntar -xJf saved_models.tar.xz\nrm saved_models.tar.xz\n```\n\n### Detector\nThe 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](https://github.com/GeorgeSeif/Semantic-Segmentation-Suite). 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.\n\nThe exported detector model can be downloaded with the following command:\n```bash=\nwget http://people.eecs.berkeley.edu/~tancik/stegastamp/detector_models.tar.xz\ntar -xJf detector_models.tar.xz\nrm detector_models.tar.xz\n```\n\n### Tensorboard\nTo visualize the training run the following command and navigate to http://localhost:6006 in your browser.\n```bash=\ntensorboard --logdir logs\n```\n\n## Encoding a Message\nThe 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 \u003c= 7 characters (100 bit message -\u003e 56 bits after ECC).\n\nEncode a message into an image:\n```bash=\npython encode_image.py \\\n  saved_models/stegastamp_pretrained \\\n  --image test_im.png  \\\n  --save_dir out/ \\\n  --secret Hello\n```\nThis will save both the StegaStamp and the residual that was applied to the original image.\n\nOr run the bash code directly:\n```bash=\nbash encode_image.sh\n```\n\n## Decoding a Message\nThe script `decode_image.py` can be used to decode a message from a StegaStamp.\n\nExample usage:\n```bash=\npython decode_image.py \\\n  saved_models/stegastamp_pretrained \\\n  --image out/test_hidden.png\n```\n\nSamely, or run the bash code directly:\n```bash=\nbash decode_image.sh\n```\n\n## Detecting and Decoding\nThe 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.\n\nTo use the detector, make sure to download the detector model as described in the installation section. The recomended input video resolution is 1920x1080.\n\n```bash=\npython detector.py \\\n  --detector_model detector_models/stegastamp_detector \\\n  --decoder_model saved_models/stegastamp_pretrained \\\n  --video test_vid.mp4\n```\n\n\u003cstrong\u003eDiscription:\u003c/strong\u003e\n- Add the `--save_video FILENAME` flag to save out the results.\n\n- 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.\n\nSamely, or run the bash code directly:\n```bash=\nbash detector.sh\n```\nin the terminal.\n\n### Detecting and Decoding from Webcam\nIn browser \n\n```bash=\nlocalhost:8080/detecdecode.html\n```\n\n## Example Encoded Images\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003ctd\u003e\u003cimg src=\"https://uploads-ssl.webflow.com/51e0d73d83d06baa7a00000f/5ca4ece3a76f9674cb331922_original_0.png\" id=\"w-node-ac7c80dba393-64fa863e\" alt=\"\"/\u003e\u003c/td\u003e\n\t\t\t\u003ctd\u003e\u003cimg src=\"https://uploads-ssl.webflow.com/51e0d73d83d06baa7a00000f/5ca4ece369dd90202b3b9d7a_hidden_0.png\" id=\"w-node-36366b9dbcb2-64fa863e\" alt=\"\"/\u003e\u003c/td\u003e\n\t\t\t\u003ctd\u003e\u003cimg src=\"https://uploads-ssl.webflow.com/51e0d73d83d06baa7a00000f/5ca4ece30eb6b33f8d4267ef_residual_0.png\" id=\"w-node-e80884ffd5de-64fa863e\" alt=\"\"/\u003e\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003ctd\u003e\u003cimg src=\"https://uploads-ssl.webflow.com/51e0d73d83d06baa7a00000f/5ca4ece30eb6b39b324267f0_original_28.png\" id=\"w-node-9c2eeb0f55f3-64fa863e\" alt=\"\"/\u003e\u003c/td\u003e\n\t\t\t\u003ctd\u003e\u003cimg src=\"https://uploads-ssl.webflow.com/51e0d73d83d06baa7a00000f/5ca4ece369dd9061a43b9d7c_hidden_28.png\" id=\"w-node-3fd6c27963f0-64fa863e\" alt=\"\"/\u003e\u003c/td\u003e\n\t\t\t\u003ctd\u003e\u003cimg src=\"https://uploads-ssl.webflow.com/51e0d73d83d06baa7a00000f/5ca4ece39ef4082d8c846fd6_residual_28.png\" id=\"w-node-f172e4fdbcf9-64fa863e\" alt=\"\"/\u003e\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\t\u003ctr\u003e\t\t\n\t\t\t\u003ctd\u003e\u003cimg src=\"https://uploads-ssl.webflow.com/51e0d73d83d06baa7a00000f/5ca4ece30eb6b3070b4267f1_original_25.png\" id=\"w-node-1cb605591b2c-64fa863e\" alt=\"\"/\u003e\u003c/td\u003e\n\t\t\t\u003ctd\u003e\u003cimg src=\"https://uploads-ssl.webflow.com/51e0d73d83d06baa7a00000f/5ca4ece30eb6b30f6e4267f2_hidden_25.png\" id=\"w-node-cc09a898c4fe-64fa863e\" alt=\"\"/\u003e\u003c/td\u003e\n\t\t\t\u003ctd\u003e\u003cimg src=\"https://uploads-ssl.webflow.com/51e0d73d83d06baa7a00000f/5ca4ece33f994729c3605a22_residual_25.png\" id=\"w-node-0c2b7ac3257b-64fa863e\" alt=\"\"/\u003e\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003ctd\u003e\u003cdiv id=\"w-node-c76dcfc62cf8-64fa863e\" class=\"stega_example_label\"\u003eOriginal Image\u003c/div\u003e\u003c/td\u003e\n\t\t\t\u003ctd\u003e\u003cdiv id=\"w-node-62d402cd6de4-64fa863e\" class=\"stega_example_label\"\u003eStegaStamp\u003c/div\u003e\u003c/td\u003e\n\t\t\t\u003ctd\u003e\u003cdiv id=\"w-node-3acde7b9475e-64fa863e\" class=\"stega_example_label\"\u003eResidual\u003c/div\u003e\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp class=\"paragraph-3 stega_text\"\u003eHere are examples of images that have been converted to StegaStamps. The residual depicts the difference between the original image and the StegaStamp.\u003c/p\u003e\n\t\n## Results\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003ctd\u003e\u003cimg src=\"https://uploads-ssl.webflow.com/51e0d73d83d06baa7a00000f/5ca4f5095181343d9eac9d81_oblique.gif\" alt=\"\" class=\"image-7\"/\u003e\u003c/td\u003e\n\t\t\t\u003ctd\u003e\u003cimg src=\"https://uploads-ssl.webflow.com/51e0d73d83d06baa7a00000f/5ca4fcb6b1119cca3212a112_lighting.gif\" alt=\"\"/\u003e\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003ctd\u003e\u003cdiv class=\"captions\"\u003eOblique Angles\u003c/div\u003e\u003c/td\u003e\n\t\t\t\u003ctd\u003e\u003cdiv class=\"captions\"\u003eVariable Lighting\u003c/div\u003e\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003ctd\u003e\u003cimg src=\"https://uploads-ssl.webflow.com/51e0d73d83d06baa7a00000f/5ca4f8dd79305788c84a1319_occlusion.gif\" alt=\"\"/\u003e\u003c/td\u003e\n\t\t\t\u003ctd\u003e\u003cimg src=\"https://uploads-ssl.webflow.com/51e0d73d83d06baa7a00000f/5ca4f6dc518134364eacd8d8_reflection.gif\" alt=\"\"/\u003e\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003ctd\u003e\u003cdiv class=\"captions\"\u003eOcclusion\u003c/div\u003e\u003c/td\u003e\n\t\t\t\u003ctd\u003e\u003cdiv class=\"captions\"\u003eReflections\u003c/div\u003e\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp class=\"paragraph-3 stega_text stega_results_text\"\u003eHere are examples of detection and decoding. The percentage corresponds to the number of bits correctly decoded. Each of these examples encode 100 bits. \u003c/p\u003e\n\n## Getting Started Yourself\n\nThe project is still a work in progress, but I want to put it out so that I get some good suggestions.\n\nThe easiest way to get started is to simply try out on Colab: \n\n[\u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" align=\"center\"\u003e](https://colab.research.google.com/github/Charmve/StegaStamp/blob/master/StegaStamp_train_model.ipynb)  \n\nThe secret.len is limited 7 characters (56 bit).\n\n## Disclaimer\n\nThanks to the excilent open source work from Matthew Tancik, Ben Mildenhall, et.al !\n\n\u003e Any interest disputes and social consequences arising from using this method have nothing to do with the open source author of this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharmve%2Fstegastamp-plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharmve%2Fstegastamp-plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharmve%2Fstegastamp-plus/lists"}