latentplot


Namelatentplot JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/luiscarlosgph/latentplot
SummaryPython module to produce an image plot of latent spaces.
upload_time2023-03-31 13:38:01
maintainer
docs_urlNone
authorLuis C. Garcia-Peraza Herrera
requires_python
licenseMIT License
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Description
-----------

Python package to plot the latent space of a set of images with different methods.


Install with pip
----------------

```bash
$ python3 -m pip install latentplot --user
```


Install from source
-------------------

```bash
$ git clone https://github.com/luiscarlosgph/latentplot.git
$ cd latentplot
$ python3 setup.py install --user
```


Exemplary code snippet
----------------------

```python
# List of images of shape (H, W, 3) and BGR
images = [ ... ]           

# List of vectors of shape (D,), where D is the vector dimension
feature_vectors = [ ... ]  

# List of integer class labels
labels = [ ... ]           

# Produce a BGR image containing a 2D plot of the latent space with t-SNE
plotter = latentplot.Plotter(method='tsne')                              
im_tsne = plotter.plot(images, feature_vectors, labels)  # Providing labels here is optional
```

The `latentplot.Plotter` constructor parameters are:

* **method**: method used to reduce the feature vectors to a 2D space. Available options: **pca**, **tsne**, **umap**.      
* **width**: desired output image width. Default is 15360 pixels (16K).                         
* **height**: desired output image height. Default is 8640 pixels (16K).                          
* **dpi**: DPI for the output image. Default is 300.                     
* **cell_factor**: proportion of the reduced space that each cell will occupy. Default is 0.01.                          
* **dark_mode**: set it to False to have a white background with black font. Default is True.              
* **hide_axes**: hide axes, ticks and marks. Default is True.   
* ****kwargs**: the rest of the arguments you pass will be forwarded to the dimensionality reduction method.


Exemplary results
-----------------

* [CIFAR-10](https://www.cs.toronto.edu/~kriz/cifar.html):


<!---
* [PascalVOC](http://host.robots.ox.ac.uk/pascal/VOC):

   TODO

* [Cholec80](http://camma.u-strasbg.fr/datasets):

   TODO
-->


Author
------

Luis Carlos Garcia Peraza Herrera (luiscarlos.gph@gmail.com), 2023.


License
-------

This code repository is shared under an [MIT license](LICENSE).



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/luiscarlosgph/latentplot",
    "name": "latentplot",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Luis C. Garcia-Peraza Herrera",
    "author_email": "luiscarlos.gph@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/91/44/bded27e25b7597a3c02cbd99f10f86a7b626d63c96269477d8f507dc422f/latentplot-0.0.1.tar.gz",
    "platform": null,
    "description": "Description\n-----------\n\nPython package to plot the latent space of a set of images with different methods.\n\n\nInstall with pip\n----------------\n\n```bash\n$ python3 -m pip install latentplot --user\n```\n\n\nInstall from source\n-------------------\n\n```bash\n$ git clone https://github.com/luiscarlosgph/latentplot.git\n$ cd latentplot\n$ python3 setup.py install --user\n```\n\n\nExemplary code snippet\n----------------------\n\n```python\n# List of images of shape (H, W, 3) and BGR\nimages = [ ... ]           \n\n# List of vectors of shape (D,), where D is the vector dimension\nfeature_vectors = [ ... ]  \n\n# List of integer class labels\nlabels = [ ... ]           \n\n# Produce a BGR image containing a 2D plot of the latent space with t-SNE\nplotter = latentplot.Plotter(method='tsne')                              \nim_tsne = plotter.plot(images, feature_vectors, labels)  # Providing labels here is optional\n```\n\nThe `latentplot.Plotter` constructor parameters are:\n\n* **method**: method used to reduce the feature vectors to a 2D space. Available options: **pca**, **tsne**, **umap**.      \n* **width**: desired output image width. Default is 15360 pixels (16K).                         \n* **height**: desired output image height. Default is 8640 pixels (16K).                          \n* **dpi**: DPI for the output image. Default is 300.                     \n* **cell_factor**: proportion of the reduced space that each cell will occupy. Default is 0.01.                          \n* **dark_mode**: set it to False to have a white background with black font. Default is True.              \n* **hide_axes**: hide axes, ticks and marks. Default is True.   \n* ****kwargs**: the rest of the arguments you pass will be forwarded to the dimensionality reduction method.\n\n\nExemplary results\n-----------------\n\n* [CIFAR-10](https://www.cs.toronto.edu/~kriz/cifar.html):\n\n\n<!---\n* [PascalVOC](http://host.robots.ox.ac.uk/pascal/VOC):\n\n   TODO\n\n* [Cholec80](http://camma.u-strasbg.fr/datasets):\n\n   TODO\n-->\n\n\nAuthor\n------\n\nLuis Carlos Garcia Peraza Herrera (luiscarlos.gph@gmail.com), 2023.\n\n\nLicense\n-------\n\nThis code repository is shared under an [MIT license](LICENSE).\n\n\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Python module to produce an image plot of latent spaces.",
    "version": "0.0.1",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "707b613756fbe879af8df62a9a1838de3870c5f9018dd7a7bcc9cadf136f451c",
                "md5": "88b0dc5eb9e3ea111c197976c133aeff",
                "sha256": "9475b099ca67b06f421ef8534318c53abcfc6a4395dbffbce6a65c8e4d2610fc"
            },
            "downloads": -1,
            "filename": "latentplot-0.0.1-py3.9.egg",
            "has_sig": false,
            "md5_digest": "88b0dc5eb9e3ea111c197976c133aeff",
            "packagetype": "bdist_egg",
            "python_version": "0.0.1",
            "requires_python": null,
            "size": 12584,
            "upload_time": "2023-03-31T13:37:59",
            "upload_time_iso_8601": "2023-03-31T13:37:59.608751Z",
            "url": "https://files.pythonhosted.org/packages/70/7b/613756fbe879af8df62a9a1838de3870c5f9018dd7a7bcc9cadf136f451c/latentplot-0.0.1-py3.9.egg",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9144bded27e25b7597a3c02cbd99f10f86a7b626d63c96269477d8f507dc422f",
                "md5": "24bef417251ea78b0f3833cde824e874",
                "sha256": "06d5e0cadc326ef97f0a3dd9d8ce394f0a8c25e3539d39e8fa3b623d6a2c7c8d"
            },
            "downloads": -1,
            "filename": "latentplot-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "24bef417251ea78b0f3833cde824e874",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 8396,
            "upload_time": "2023-03-31T13:38:01",
            "upload_time_iso_8601": "2023-03-31T13:38:01.990994Z",
            "url": "https://files.pythonhosted.org/packages/91/44/bded27e25b7597a3c02cbd99f10f86a7b626d63c96269477d8f507dc422f/latentplot-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-31 13:38:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "luiscarlosgph",
    "github_project": "latentplot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "latentplot"
}
        
Elapsed time: 0.04944s