├── images └── add_your_images_here ├── dev-requirements.in ├── readme_images └── screenshot.png ├── requirements.in ├── Justfile ├── README.md ├── dev-requirements.txt ├── requirements.txt ├── .gitignore └── LICENSE.md /images/add_your_images_here: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dev-requirements.in: -------------------------------------------------------------------------------- 1 | -c requirements.in 2 | black[jupyter] 3 | pip-tools -------------------------------------------------------------------------------- /readme_images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-developer/image-search-vector-demo/HEAD/readme_images/screenshot.png -------------------------------------------------------------------------------- /requirements.in: -------------------------------------------------------------------------------- 1 | jupyter==1.0.0 2 | matplotlib==3.8.0 3 | opencv-python==4.8.1.78 4 | Pillow==10.1.0 5 | pymongo[srv]==4.5.0 6 | sentence-transformers==2.2.2 7 | tqdm==4.66.1 8 | ipywidgets==8.1.1 -------------------------------------------------------------------------------- /Justfile: -------------------------------------------------------------------------------- 1 | default: 2 | just --list 3 | 4 | run: 5 | jupyter notebook 'Image Search.ipynb' 6 | 7 | update: 8 | pip-compile requirements.in --strip-extras 9 | pip-compile dev-requirements.in 10 | pip install -r requirements.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Image Search with MongoDB Atlas Vector Search 2 | 3 | This repository contains a Jupyter Notebook demonstrating how to generate 4 | vector embeddings for both text and images using a multi-modal embedding model. 5 | 6 | ## Getting Ready To Run The Notebook 7 | 8 | The first thing you'll want to do is create a virtual environment using your favorite technique. I tend to use [venv](https://docs.python.org/3/library/venv.html), which comes with Python. 9 | 10 | Once you've done that, install dependencies with: 11 | 12 | ``` 13 | pip install -r requirements.txt 14 | ``` 15 | 16 | You'll need to set an environment variable, `MONGODB_URI`, containing the connection string for your MongoDB cluster. 17 | 18 | One more thing you'll need is an "images" directory, containing some images to index! I downloaded  [Kaggle's ImageNet 1000 (mini) dataset](https://www.kaggle.com/datasets/ifigotin/imagenetmini-1000), which contains lots of images at around 4GB, but you can use a different dataset if you prefer. The notebook searches the "images" directory recursively, so you don't need to have everything at the top-level. 19 | 20 | Then you can fire up the notebook with: 21 | 22 | ``` 23 | jupyter notebook "Image Search.ipynb" 24 | ``` 25 | 26 | At the end of the tutorial, you'll be able to search for images with snippets 27 | of text, like this: 28 | 29 | ![A screenshot of a line of code searching for "corgi in the snow" followed by a grid of animal photos.](readme_images/screenshot.png) -------------------------------------------------------------------------------- /dev-requirements.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is autogenerated by pip-compile with Python 3.11 3 | # by the following command: 4 | # 5 | # pip-compile dev-requirements.in 6 | # 7 | asttokens==2.4.1 8 | # via stack-data 9 | black[jupyter]==24.1.1 10 | # via -r dev-requirements.in 11 | build==1.0.3 12 | # via pip-tools 13 | click==8.1.7 14 | # via 15 | # black 16 | # pip-tools 17 | decorator==5.1.1 18 | # via ipython 19 | executing==2.0.1 20 | # via stack-data 21 | ipython==8.20.0 22 | # via black 23 | jedi==0.19.1 24 | # via ipython 25 | matplotlib-inline==0.1.6 26 | # via ipython 27 | mypy-extensions==1.0.0 28 | # via black 29 | packaging==23.2 30 | # via 31 | # black 32 | # build 33 | parso==0.8.3 34 | # via jedi 35 | pathspec==0.12.1 36 | # via black 37 | pexpect==4.9.0 38 | # via ipython 39 | pip-tools==7.3.0 40 | # via -r dev-requirements.in 41 | platformdirs==4.1.0 42 | # via black 43 | prompt-toolkit==3.0.43 44 | # via ipython 45 | ptyprocess==0.7.0 46 | # via pexpect 47 | pure-eval==0.2.2 48 | # via stack-data 49 | pygments==2.17.2 50 | # via ipython 51 | pyproject-hooks==1.0.0 52 | # via build 53 | six==1.16.0 54 | # via asttokens 55 | stack-data==0.6.3 56 | # via ipython 57 | tokenize-rt==5.2.0 58 | # via black 59 | traitlets==5.14.1 60 | # via 61 | # ipython 62 | # matplotlib-inline 63 | wcwidth==0.2.13 64 | # via prompt-toolkit 65 | wheel==0.42.0 66 | # via pip-tools 67 | 68 | # The following packages are considered to be unsafe in a requirements file: 69 | # pip 70 | # setuptools 71 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is autogenerated by pip-compile with Python 3.11 3 | # by the following command: 4 | # 5 | # pip-compile --output-file=requirements.txt requirements.in 6 | # 7 | asttokens==2.4.1 8 | # via stack-data 9 | certifi==2023.7.22 10 | # via requests 11 | charset-normalizer==3.3.2 12 | # via requests 13 | click==8.1.7 14 | # via nltk 15 | comm==0.2.1 16 | # via ipywidgets 17 | contourpy==1.1.1 18 | # via matplotlib 19 | cycler==0.12.1 20 | # via matplotlib 21 | decorator==5.1.1 22 | # via ipython 23 | dnspython==2.4.2 24 | # via pymongo 25 | executing==2.0.1 26 | # via stack-data 27 | filelock==3.13.1 28 | # via 29 | # huggingface-hub 30 | # torch 31 | # transformers 32 | fonttools==4.43.1 33 | # via matplotlib 34 | fsspec==2023.10.0 35 | # via 36 | # huggingface-hub 37 | # torch 38 | huggingface-hub==0.17.3 39 | # via 40 | # sentence-transformers 41 | # tokenizers 42 | # transformers 43 | idna==3.4 44 | # via requests 45 | ipython==8.20.0 46 | # via ipywidgets 47 | ipywidgets==8.1.1 48 | # via -r requirements.in 49 | jedi==0.19.1 50 | # via ipython 51 | jinja2==3.1.2 52 | # via torch 53 | joblib==1.3.2 54 | # via 55 | # nltk 56 | # scikit-learn 57 | jupyterlab-widgets==3.0.9 58 | # via ipywidgets 59 | kiwisolver==1.4.5 60 | # via matplotlib 61 | markupsafe==2.1.3 62 | # via jinja2 63 | matplotlib==3.8.0 64 | # via -r requirements.in 65 | matplotlib-inline==0.1.6 66 | # via ipython 67 | mpmath==1.3.0 68 | # via sympy 69 | networkx==3.2.1 70 | # via torch 71 | nltk==3.8.1 72 | # via sentence-transformers 73 | numpy==1.26.1 74 | # via 75 | # contourpy 76 | # matplotlib 77 | # opencv-python 78 | # scikit-learn 79 | # scipy 80 | # sentence-transformers 81 | # torchvision 82 | # transformers 83 | opencv-python==4.8.1.78 84 | # via -r requirements.in 85 | packaging==23.2 86 | # via 87 | # huggingface-hub 88 | # matplotlib 89 | # transformers 90 | parso==0.8.3 91 | # via jedi 92 | pexpect==4.9.0 93 | # via ipython 94 | pillow==10.1.0 95 | # via 96 | # -r requirements.in 97 | # matplotlib 98 | # torchvision 99 | prompt-toolkit==3.0.43 100 | # via ipython 101 | ptyprocess==0.7.0 102 | # via pexpect 103 | pure-eval==0.2.2 104 | # via stack-data 105 | pygments==2.17.2 106 | # via ipython 107 | pymongo[srv]==4.5.0 108 | # via 109 | # -r requirements.in 110 | # pymongo 111 | pyparsing==3.1.1 112 | # via matplotlib 113 | python-dateutil==2.8.2 114 | # via matplotlib 115 | pyyaml==6.0.1 116 | # via 117 | # huggingface-hub 118 | # transformers 119 | regex==2023.10.3 120 | # via 121 | # nltk 122 | # transformers 123 | requests==2.31.0 124 | # via 125 | # huggingface-hub 126 | # torchvision 127 | # transformers 128 | safetensors==0.4.0 129 | # via transformers 130 | scikit-learn==1.3.2 131 | # via sentence-transformers 132 | scipy==1.11.3 133 | # via 134 | # scikit-learn 135 | # sentence-transformers 136 | sentence-transformers==2.2.2 137 | # via -r requirements.in 138 | sentencepiece==0.1.99 139 | # via sentence-transformers 140 | six==1.16.0 141 | # via 142 | # asttokens 143 | # python-dateutil 144 | stack-data==0.6.3 145 | # via ipython 146 | sympy==1.12 147 | # via torch 148 | threadpoolctl==3.2.0 149 | # via scikit-learn 150 | tokenizers==0.14.1 151 | # via transformers 152 | torch==2.1.0 153 | # via 154 | # sentence-transformers 155 | # torchvision 156 | torchvision==0.16.0 157 | # via sentence-transformers 158 | tqdm==4.66.1 159 | # via 160 | # -r requirements.in 161 | # huggingface-hub 162 | # nltk 163 | # sentence-transformers 164 | # transformers 165 | traitlets==5.14.1 166 | # via 167 | # comm 168 | # ipython 169 | # ipywidgets 170 | # matplotlib-inline 171 | transformers==4.34.1 172 | # via sentence-transformers 173 | typing-extensions==4.8.0 174 | # via 175 | # huggingface-hub 176 | # torch 177 | urllib3==2.0.7 178 | # via requests 179 | wcwidth==0.2.13 180 | # via prompt-toolkit 181 | widgetsnbextension==4.0.9 182 | # via ipywidgets 183 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.toptal.com/developers/gitignore/api/python,osx 2 | # Edit at https://www.toptal.com/developers/gitignore?templates=python,osx 3 | 4 | ### OSX ### 5 | # General 6 | .DS_Store 7 | .AppleDouble 8 | .LSOverride 9 | 10 | # Icon must end with two \r 11 | Icon 12 | 13 | 14 | # Thumbnails 15 | ._* 16 | 17 | # Files that might appear in the root of a volume 18 | .DocumentRevisions-V100 19 | .fseventsd 20 | .Spotlight-V100 21 | .TemporaryItems 22 | .Trashes 23 | .VolumeIcon.icns 24 | .com.apple.timemachine.donotpresent 25 | 26 | # Directories potentially created on remote AFP share 27 | .AppleDB 28 | .AppleDesktop 29 | Network Trash Folder 30 | Temporary Items 31 | .apdisk 32 | 33 | ### Python ### 34 | # Byte-compiled / optimized / DLL files 35 | __pycache__/ 36 | *.py[cod] 37 | *$py.class 38 | 39 | # C extensions 40 | *.so 41 | 42 | # Distribution / packaging 43 | .Python 44 | build/ 45 | develop-eggs/ 46 | dist/ 47 | downloads/ 48 | eggs/ 49 | .eggs/ 50 | lib/ 51 | lib64/ 52 | parts/ 53 | sdist/ 54 | var/ 55 | wheels/ 56 | share/python-wheels/ 57 | *.egg-info/ 58 | .installed.cfg 59 | *.egg 60 | MANIFEST 61 | 62 | # PyInstaller 63 | # Usually these files are written by a python script from a template 64 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 65 | *.manifest 66 | *.spec 67 | 68 | # Installer logs 69 | pip-log.txt 70 | pip-delete-this-directory.txt 71 | 72 | # Unit test / coverage reports 73 | htmlcov/ 74 | .tox/ 75 | .nox/ 76 | .coverage 77 | .coverage.* 78 | .cache 79 | nosetests.xml 80 | coverage.xml 81 | *.cover 82 | *.py,cover 83 | .hypothesis/ 84 | .pytest_cache/ 85 | cover/ 86 | 87 | # Translations 88 | *.mo 89 | *.pot 90 | 91 | # Django stuff: 92 | *.log 93 | local_settings.py 94 | db.sqlite3 95 | db.sqlite3-journal 96 | 97 | # Flask stuff: 98 | instance/ 99 | .webassets-cache 100 | 101 | # Scrapy stuff: 102 | .scrapy 103 | 104 | # Sphinx documentation 105 | docs/_build/ 106 | 107 | # PyBuilder 108 | .pybuilder/ 109 | target/ 110 | 111 | # Jupyter Notebook 112 | .ipynb_checkpoints 113 | 114 | # IPython 115 | profile_default/ 116 | ipython_config.py 117 | 118 | # pyenv 119 | # For a library or package, you might want to ignore these files since the code is 120 | # intended to run in multiple environments; otherwise, check them in: 121 | # .python-version 122 | 123 | # pipenv 124 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 125 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 126 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 127 | # install all needed dependencies. 128 | #Pipfile.lock 129 | 130 | # poetry 131 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 132 | # This is especially recommended for binary packages to ensure reproducibility, and is more 133 | # commonly ignored for libraries. 134 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 135 | #poetry.lock 136 | 137 | # pdm 138 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 139 | #pdm.lock 140 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 141 | # in version control. 142 | # https://pdm.fming.dev/#use-with-ide 143 | .pdm.toml 144 | 145 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 146 | __pypackages__/ 147 | 148 | # Celery stuff 149 | celerybeat-schedule 150 | celerybeat.pid 151 | 152 | # SageMath parsed files 153 | *.sage.py 154 | 155 | # Environments 156 | .env 157 | .venv 158 | env/ 159 | venv/ 160 | ENV/ 161 | env.bak/ 162 | venv.bak/ 163 | 164 | # Spyder project settings 165 | .spyderproject 166 | .spyproject 167 | 168 | # Rope project settings 169 | .ropeproject 170 | 171 | # mkdocs documentation 172 | /site 173 | 174 | # mypy 175 | .mypy_cache/ 176 | .dmypy.json 177 | dmypy.json 178 | 179 | # Pyre type checker 180 | .pyre/ 181 | 182 | # pytype static type analyzer 183 | .pytype/ 184 | 185 | # Cython debug symbols 186 | cython_debug/ 187 | 188 | # PyCharm 189 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 190 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 191 | # and can be added to the global gitignore or merged into this file. For a more nuclear 192 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 193 | #.idea/ 194 | 195 | ### Python Patch ### 196 | # Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration 197 | poetry.toml 198 | 199 | # ruff 200 | .ruff_cache/ 201 | 202 | # LSP config files 203 | pyrightconfig.json 204 | 205 | # End of https://www.toptal.com/developers/gitignore/api/python,osx 206 | 207 | images/* 208 | blog_post 209 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------