Skip to content

Commit

Permalink
Fixes #11, implements helpers for images, knn
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Nov 11, 2018
1 parent 649d95e commit e297fda
Show file tree
Hide file tree
Showing 18 changed files with 1,717 additions and 62 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -327,3 +327,5 @@ _unittests/.vscode/settings.json
_doc/examples/images
_doc/sphinxdoc/source/gyexamples/
_doc/sphinxdoc/source/nbcov*.png
_doc/notebooks/hackathon_2018/batch/
_doc/notebooks/hackathon_2018/img5050/
114 changes: 85 additions & 29 deletions _doc/notebooks/cheat_sheets/chsh_images.ipynb

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions _doc/notebooks/hackathon_2018/README.txt
@@ -0,0 +1,4 @@
Materials for the ENSAE Hackathon 2018
--------------------------------------

See more about this hackathon at :ref:`l-hackathon-2018`.
596 changes: 596 additions & 0 deletions _doc/notebooks/hackathon_2018/images_dups.ipynb

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions _doc/sphinxdoc/source/api/hackathon.rst
Expand Up @@ -5,6 +5,45 @@ Hackathon Helpers
.. contents::
:local:

.. _l-hack-fct-2018:

2018
++++

Functions about images
^^^^^^^^^^^^^^^^^^^^^^

.. autosignature:: ensae_projects.hackathon.image_helper.enumerate_batch_features

.. autosignature:: ensae_projects.hackathon.image_helper.enumerate_image_class

.. autosignature:: ensae_projects.hackathon.image_helper.histogram_image_size

.. autosignature:: ensae_projects.hackathon.image_helper.img2gray

.. autosignature:: ensae_projects.hackathon.image_helper.image_zoom

.. autosignature:: ensae_projects.hackathon.image_helper.load_batch_features

.. autosignature:: ensae_projects.hackathon.image_helper.read_image

.. autosignature:: ensae_projects.hackathon.image_helper.stream_apply_image_transform

.. autosignature:: ensae_projects.hackathon.image_helper.stream_copy_images

.. autosignature:: ensae_projects.hackathon.image_helper.stream_download_images

.. autosignature:: ensae_projects.hackathon.image_helper.stream_image2features

Some of these functions are used in notebook :ref:`imagesdupsrst`.
Many examples can be found in unit test
`test_image.py <https://github.com/sdpython/ensae_projects/blob/master/_unittests/ut_hackathon/test_image.py>`_.

Functions or classes to analyse
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. autosignature:: ensae_projects.hackathon.image_knn.ImageNearestNeighbors

2017
++++

Expand Down
44 changes: 27 additions & 17 deletions _doc/sphinxdoc/source/conf.py
Expand Up @@ -26,20 +26,30 @@
'css_files': get_default_stylesheet() + ['_static/my-styles.css'],
}

epkg_dictionary['B-Corp'] = "https://bcorporation.eu/about-b-lab/country-partner/france"
epkg_dictionary['BRGM'] = "http://www.brgm.fr/"
epkg_dictionary['cartopy'] = "https://scitools.org.uk/cartopy/docs/latest/"
epkg_dictionary['Cresus'] = "http://www.cresus-france.org/"
epkg_dictionary['data leakage'] = "https://www.kaggle.com/wiki/Leakage"
epkg_dictionary['ESUS'] = "https://www.service-public.fr/professionnels-entreprises/vosdroits/F32275"
epkg_dictionary['falcon'] = "https://falconframework.org/"
epkg_dictionary['ijson'] = "https://pypi.python.org/pypi/ijson"
epkg_dictionary['keras'] = "https://keras.io/"
epkg_dictionary['keyring'] = "https://pypi.python.org/pypi/keyring"
epkg_dictionary['Label Emmaüs'] = 'https://www.label-emmaus.co/'
epkg_dictionary['Latitudes'] = "http://www.latitudes.cc/"
epkg_dictionary['lightmlrestapi'] = "http://www.xavierdupre.fr/app/lightmlrestapi/helpsphinx/index.html"
epkg_dictionary['Microdon'] = "https://www.microdon.org/"
epkg_dictionary['REST API'] = "https://en.wikipedia.org/wiki/Representational_state_transfer"
epkg_dictionary['waitress'] = "https://docs.pylonsproject.org/projects/waitress/en/latest/"
epkg_dictionary['WSGI'] = "https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface"
epkg_dictionary.update({
'B-Corp': "https://bcorporation.eu/about-b-lab/country-partner/france",
'BRGM': "http://www.brgm.fr/",
'cartopy': "https://scitools.org.uk/cartopy/docs/latest/",
'Cresus': "http://www.cresus-france.org/",
'data leakage': "https://www.kaggle.com/wiki/Leakage",
'ensae_projects': 'https://pypi.org/project/ensae_projects/',
'ESUS': "https://www.service-public.fr/professionnels-entreprises/vosdroits/F32275",
'falcon': "https://falconframework.org/",
'ijson': "https://pypi.python.org/pypi/ijson",
'ImageNet': "http://www.image-net.org/",
'keras': "https://keras.io/",
'keyring': "https://pypi.python.org/pypi/keyring",
'kneighbors': 'https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.NearestNeighbors.html#sklearn.neighbors.NearestNeighbors.kneighbors',
'kneighbors_graph': 'https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.NearestNeighbors.html#sklearn.neighbors.NearestNeighbors.kneighbors_graph',
'NearestNeighbors': 'https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.NearestNeighbors.html',
'Label Emmaüs': 'https://www.label-emmaus.co/',
'Latitudes': "http://www.latitudes.cc/",
'lightmlrestapi': "http://www.xavierdupre.fr/app/lightmlrestapi/helpsphinx/index.html",
'Microdon': "https://www.microdon.org/",
'PIL.Image': "https://pillow.readthedocs.io/en/5.1.x/reference/Image.html",
'plot_gallery_images': 'http://www.xavierdupre.fr/app/mlinsights/helpsphinx/mlinsights/plotting/gallery.html#mlinsights.plotting.gallery.plot_gallery_images',
'radius_neighbors': 'https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.NearestNeighbors.html#sklearn.neighbors.NearestNeighbors.radius_neighbors',
'REST API': "https://en.wikipedia.org/wiki/Representational_state_transfer",
'waitress': "https://docs.pylonsproject.org/projects/waitress/en/latest/",
'WSGI': "https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface",
})
38 changes: 33 additions & 5 deletions _doc/sphinxdoc/source/projects/hackathon_2018.rst
Expand Up @@ -66,18 +66,46 @@ de 90 étudiants se sont inscrits…
Challenge deep learning
^^^^^^^^^^^^^^^^^^^^^^^

La construction d'un défi n'a pas été simple pour ce challenge.
Une vue d'ensemble des images montre que les photos partagées
sur twitter illustrent des inondations sérieuses, des voitures sous
l'eau, des bateaux dans les rues. Il y a peu de photos d'intérieures
dévastés. Le problème est plus flagrant pour les séismes ou peu de
gens prennent des photos au regard du nombre de gens
qui les propagent. Cela tient sans doute à la soudaineté
de la catastrophe. Les personnes sont surprises et plongées
dans l'urgence alors qu'une inondation monte lentement et laisse
le temps de prendre des photos du danger.

La base d'images sur tweeter regroupe de nombreuses images
d'inondations ou de séims, des cartes. A cela ont été ajoutées
des images de la base :epkg:`ImageNet` pour avoir des images
de rues non inondées assez rares dans la base récoltées par
le :epkg:`BRGM`. Des images ont été récupérées depuis l'url
suivant : `ImageNet/street <http://www.image-net.org/search?q=street>`_.
Il n'est pas interdit d'en ajouter d'autres.

Le jeu de données fourni pour le hackathon contient :

* Les images initiales extraites de tweeter.
* Les images sans doublons extraites par une méthode statistiques.
* Des images extraites de :ref:`ImageNet`
* Quelques images annotées.

Challenge machine learning
^^^^^^^^^^^^^^^^^^^^^^^^^^

Eléments de code
----------------

**Challenge deep learning**
Vous pouvez importer le module :epkg:`ensae_projects`
ou copier/coller le code.

**Challenge machine learning**
* :ref:`l-hack-fct-2018`
* :ref:`chshimagesrst`

Manipulation d'images et premiers avec le deep learning
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Manipulation d'images et premiers pas avec le deep learning
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* `Search images with deep learning <http://www.xavierdupre.fr/app/mlinsights/helpsphinx/notebooks/search_images.html>`_ :
le notebook expose comment manipuler des images avec :epkg:`keras` et comment
Expand Down Expand Up @@ -120,7 +148,7 @@ Lieu : `Numa <https://paris.numa.co/>`_
*Vendredi 16 Novembre*

* 14h00 - Accueil des participants
* 15h00 - EY, ENSAE, Genius, Latitudes, Microdon, BRGM
* 15h00 - EY, ENSAE, Genius, Latitudes, Microdon, BRGM, Numa
* 15h45 - Présentation des sujets
* 16h15 - Début du hackathon

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _unittests/ut_hackathon/data/many/cl1/img23.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _unittests/ut_hackathon/data/many/cl2/img22.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e297fda

Please sign in to comment.