Easy way to add GoogleMaps to Flask applications. maintainer: @getcake

Overview

Flask Google Maps Generic badge

Flask Estension PyPI version fury.io PyPI download month PyPI license PyPI format PyPI status CI-Github Code style: black

Easy to use Google Maps in your Flask application

requires

Contribute

To contribute with the project, clone it, create a virtualenv and install all of you need to dev, see below:

git clone https://github.com/flask-extensions/Flask-GoogleMaps.git
cd Flask-GoogleMaps
poetry use env 3.8  # just to create virtualenv at the first time
poetry shell # activate virtualenv
poetry install  # to install all for dev
pre-commit install # to install pre-commit hooks

Installation

To use in your project just use your dependency manager to install it, with pip is like this:

pip install flask-googlemaps

How it works

Flask-GoogleMaps includes some global functions and template filters in your Jinja environment, also it allows you to use the Map in views if needed.

registering

in your app

from flask import Flask
from flask_googlemaps import GoogleMaps

app = Flask(__name__)

# you can set key as config
app.config['GOOGLEMAPS_KEY'] = "8JZ7i18MjFuM35dJHq70n3Hx4"

# Initialize the extension
GoogleMaps(app)

# you can also pass the key here if you prefer
GoogleMaps(app, key="8JZ7i18MjFuM35dJHq70n3Hx4")

In template

{{googlemap("my_awesome_map", lat=0.23234234, lng=-0.234234234, markers=[(0.12,
-0.45345), ...])}}

That's it! now you have some template filters and functions to use, more details in examples and screenshot below.

Usage

  • You can create the map in the view and then send to the template context
  • you can use the template functions and filters directly

1. View

from flask import Flask, render_template
from flask_googlemaps import GoogleMaps
from flask_googlemaps import Map

app = Flask(__name__, template_folder=".")
GoogleMaps(app)

@app.route("/")
def mapview():
    # creating a map in the view
    mymap = Map(
        identifier="view-side",
        lat=37.4419,
        lng=-122.1419,
        markers=[(37.4419, -122.1419)]
    )
    sndmap = Map(
        identifier="sndmap",
        lat=37.4419,
        lng=-122.1419,
        markers=[
          {
             'icon': 'http://maps.google.com/mapfiles/ms/icons/green-dot.png',
             'lat': 37.4419,
             'lng': -122.1419,
             'infobox': "<b>Hello World</b>"
          },
          {
             'icon': 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png',
             'lat': 37.4300,
             'lng': -122.1400,
             'infobox': "<b>Hello World from other place</b>"
          }
        ]
    )
    return render_template('example.html', mymap=mymap, sndmap=sndmap)

if __name__ == "__main__":
    app.run(debug=True)
Map() Parameters
  • lat: The latitude coordinate for centering the map.
  • lng: The longitude coordinate for centering the map.
  • zoom: The zoom level. Defaults to 13.
  • maptype: The map type - ROADMAP, SATELLITE, HYBRID, TERRAIN. Defaults to ROADMAP.
  • markers: Markers array of tuples having (lat, lng, infobox, icon, label). Defaults to None.
  • or markers: a list of dicts containing lat, lng, infobox, icon, label.
  • or markers: Markers dictionary with icon urls as keys and markers array as values.
  • varname: The instance variable name.
  • style: A string containing CSS styles. Defaults to "height:300px;width:300px;margin:0;".
  • identifier: The CSS ID selector name.
  • cls: The CSS Class selector name. Defaults to "map".
  • language: The map language. Defaults to "en".
  • region: The map region. Defaults to "US".

Also controls True or False:

  • zoom_control
  • maptype_control
  • scale_control
  • scale_control
  • streetview_control
  • rotate_control
  • fullscreen_control
  • scroll_wheel
  • collapsible (map collapses by click on varname_collapse button)
  • mapdisplay (show a collapsible map by default or not)
  • center_on_user_location (using HTML5 Geolocation)

2. Template

<!DOCTYPE html>
<html>
  <head>
    {{"decoupled-map"|googlemap_js(37.4419, -122.1419, markers=[(37.4419,
    -122.1419)])}} {{mymap.js}} {{sndmap.js}}
  </head>
  <body>
    <h1>Flask Google Maps Example</h1>

    <h2>Template function centered, no marker</h2>
    {{googlemap("simple-map", 37.4419, -122.1419)}}

    <h2>Template filter decoupled with single marker</h2>
    {{"decoupled-map"|googlemap_html(37.4419, -122.1419)}}

    <h2>Template function with multiple markers</h2>
    {% with map=googlemap_obj("another-map", 37.4419, -122.1419,
    markers=[(37.4419, -122.1419), (37.4300, -122.1400)]) %} {{map.html}}
    {{map.js}} {% endwith %}

    <h2>First map generated in view</h2>
    {{mymap.html}}

    <h2>Second map generated in view</h2>
    <h3>Example for different icons in multiple markers with infoboxes</h3>
    {{sndmap.html}}
  </body>
</html>

Infobox

Here's an example snippet of code:

    Map(
        identifier="catsmap",
        lat=37.4419,
        lng=-122.1419,
        markers=[
            {
                'icon': 'http://maps.google.com/mapfiles/ms/icons/green-dot.png',
                'lat':  37.4419,
                'lng':  -122.1419,
                'infobox': "<img src='cat1.jpg' />"
            },
            {
                'icon': 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png',
                'lat': 37.4300,
                'lng': -122.1400,
                'infobox': "<img src='cat2.jpg' />"
            },
            {
                'icon': 'http://maps.google.com/mapfiles/ms/icons/yellow-dot.png',
                'lat': 37.4500,
                'lng': -122.1350,
                'infobox': "<img src='cat3.jpg' />"
            }
        ]
    )

Which results in something like the following map: screen shot 2015-07-29 at 2 41 52 pm

Label

Here's an example snippet of code:

Map(
        identifier="labelsmap",
        lat=37.4419,
        lng=-122.1419,
        markers=[
            {
                'lat': 37.4500,
                'lng': -122.1350,
                'label': "X"
            },
            {
                'lat':  37.4419,
                'lng':  -122.1419,
                'label': "Y"
            },
            {
                'lat': 37.4300,
                'lng': -122.1400,
                'label': "Z"
            }
        ]
    )

Which results in something like the following map:

Map showing markers with labels

Fit all markers within bounds

Allow users to easily fit all markers within view on page load

Without bounds

@app.route('/map-unbounded/')
def map_unbounded():
"""Create map with markers out of bounds."""
    locations = []    # long list of coordinates
    map = Map(
        lat=locations[0].latitude,
        lng=locations[0].longitude,
        markers=[(loc.latitude, loc.longitude) for loc in locations]
    )
    return render_template('map.html', map=map)

image

With bounds

@app.route('/map-bounded/')
def map_bounded():
"""Create map with all markers within bounds."""
    locations = []    # long list of coordinates
    map = Map(
        lat=locations[0].latitude,
        lng=locations[0].longitude,
        markers=[(loc.latitude, loc.longitude) for loc in locations],
        fit_markers_to_bounds = True
    )
    return render_template('map.html', map=map)

image

Geocoding and Reverse Geocoding

from flask_googlemaps import get_address, get_coordinates
API_KEY = 'YOUR API KEY'

#Reverse Geocoding: getting detailed address from coordinates of a location
print(get_address(API_KEY,22.4761596,88.4149326))
#output: {'zip': '700150', 'country': 'India', 'state': 'West Bengal', 'city': 'Kolkata', 'locality': 'Kolkata', 'road': 'Techno City', 'formatted_address': 'Sirin Rd, Mauza Ranabhutia, Techno City, Kolkata, West Bengal 700150, India'}


#Geocoding: getting coordinates from address text
print(get_coordinates(API_KEY,'Netaji Subhash Engineering College Kolkata'))
#output: {'lat': 22.4761596, 'lng': 88.4149326}

Run the example app

$ git clone https://github.com/flask-extensions/Flask-GoogleMaps
$ cd Flask-GoogleMaps/

If you have Poetry

$ poetry install

without poetry

$ pip install --upgrade pip
$ pip install -e .
$ pip install -r requirements.txt

Run it.

$ FLASK_GOOGLEMAPS_KEY="YourKeyHERE" FLASK_APP=examples/example.py flask run
running on localhost:5000 .....

Access: http://localhost:5000/ and http://localhost:5000/fullmap

Contribute with the Google Maps API

Please see this page developers.google.com/maps/documentation/javascript/tutorial and contribute!

Comments
  • Add toggle for map.fitBounds() - closes issue #55

    Add toggle for map.fitBounds() - closes issue #55

    Allow users to easily fit all markers within view on page load

    Without bounds

    @app.route('/map-unbounded/')
    def map_unbounded():
    """Create map with markers out of bounds."""
        locations = []    # long list of coordinates
        map = Map(
            lat=locations[0].latitude,
            lng=locations[0].longitude,
            markers=[(loc.latitude, loc.longitude) for loc in locations]
        )
        return render_template('map.html', map=map)
    

    image

    With bounds

    @app.route('/map-bounded/')
    def map_bounded():
    """Create map with all markers within bounds."""
        locations = []    # long list of coordinates
        map = Map(
            lat=locations[0].latitude,
            lng=locations[0].longitude,
            markers=[(loc.latitude, loc.longitude) for loc in locations],
            fit_markers_to_bounds = True
        )
        return render_template('map.html', map=map)
    

    image

    opened by mattdaviscodes 9
  • Infobox for multple icons

    Infobox for multple icons

    When you have multiple icons, you can't set different infoboxes for each icon.

    In the initialize_ function in gmapsj.html, the getInfoCallback({{gmap.varname}}, "{{gmap.infobox[loop.index0]|safe}}")) is inside the markers[icon] loop:

          {% for icon in gmap.markers %}
                {% for marker in gmap.markers[icon] %}
                    var marker_{{loop.index0}} = new google.maps.Marker({
                        position: new google.maps.LatLng({{marker.0}}, {{marker.1}}),
                        map: {{gmap.varname}},
                        icon: "{{ icon }}"
                    });
                    {% if gmap.infobox != None %}
                            {% if gmap.typeflag %}
                                google.maps.event.addListener(marker_{{loop.index0}}, 'click',
                                getInfoCallback({{gmap.varname}}, "{{gmap.infobox[loop.index0]|safe}}"));
                            {% else %}
                                google.maps.event.addListener(marker_{{loop.index0}}, 'click',
                                getInfoCallback({{gmap.varname}}, "{{gmap.infobox|safe}}"));
                            {% endif %}
                    {% endif %}
                {% endfor %}
            {% endfor %}
    

    In the case where you have one marker per icon and a infobox list, you always get the first value of the list for every marker.

    It's not clear to me what's the best way to add multiple infoboxes for multiple icons without breaking the multiple infoboxes for multiple markers with one icon. Maybe a flag multipleiconflag and a call to getInfoCallback outside the marker loop?

    opened by rodrigorahal 9
  • Google Map doesn't show up in example

    Google Map doesn't show up in example

    Hello, thanks for the work !

    However, I can't even display the Google Maps in the example code. I already have a key for these Google Maps API so I added GoogleMaps(app, key = mykey) image

    Here is a screen of what I get one I run the python file:

    unnamed

    Thank you if you can help me figuring out where is the problem

    bug 
    opened by luskah 8
  • [bug] No data validation for lat and lng attributes

    [bug] No data validation for lat and lng attributes

    Describe the bug If the value of lat is beyond -90 and +90 and lng is beyond -180 and +180 then the map will actually not display anything as the values will be invalid.

    As an intelligent program, the program must raise an error message to notify the invalid input or should not accept such a value.

    To Reproduce Put invalid lat and lng values while initializing a Map object. e.g. lat=91, lng=11,

    image

    bug 
    opened by bhuveshsharma09 8
  • Ploting data from mysql DB.

    Ploting data from mysql DB.

    Hello how can i inject data from mysql to maps, i use this code but its not working:

    users = User.query.all()
    fullmap = Map(
               identifier="fullmap",
               varname="fullmap",
               style=(
                   "height:100%;"
                   "width:100%;"
                   "top:0;"
                   "left:0;"
                   "position:absolute;"
                   "z-index:10;"               
               ),
                
               lat=37.4419,
               lng=-122.1419,           
                
               markers=[
                   {           
                       'icon': 'static/img/icons/home1.png',
                       'title': 'Adresse Home',
                       'lat': user.latitude,
                       'lng': user.longitude,
                       'infobox': (
                           "Hello I am <b style='color:#ffcc00;'>YELLOW</b>!"
                           "<h3>"user.first_name"</h3>"
                           "<img src='user.image'>"
                           "<br>Images allowed!"
                       )
                   }for user in users:],
    

    Can you help me please. Thank you

    opened by ai-abdellah 8
  • Unicode error on new version

    Unicode error on new version

    I made a upgrade to the new version and i'm getting a JS error now:

    `var raw_markers = [{'lat': u'-19.9520738', 'lng': u'-43.9490132', 'icon': '//maps.google.com/mapfiles/ms/icons/red-dot.png'}];``

    You can see that it is including u in front of lat lng.

    I checked in the source and it seems to be correct gmap.markers|tojson|safe , but when using pip install flask-googlemaps --upgrade it is not installing the same version that we have here.

    Is something needed to update on pip? Maybe need to change the version? (from 0.2.2 to 0.2.3) ?

    opened by mariohmol 8
  • Erro de compatibilidade

    Erro de compatibilidade

    Opa, @rochacbruno quando tentei instalar a extensão foi retornado para mim um erro de compatibilidade com o SQLAlchemy. O erro foi o seguinte:

    Collecting flask-googlemaps
      Using cached Flask_GoogleMaps-0.2.5-py2.py3-none-any.whl
    Requirement already satisfied: flask in ./venv/lib/python3.5/site-packages (from flask-googlemaps) (0.12.2)
    Requirement already satisfied: itsdangerous>=0.21 in ./venv/lib/python3.5/site-packages (from flask->flask-googlemaps) (0.24)
    Requirement already satisfied: Jinja2>=2.4 in ./venv/lib/python3.5/site-packages (from flask->flask-googlemaps) (2.10)
    Requirement already satisfied: Werkzeug>=0.7 in ./venv/lib/python3.5/site-packages (from flask->flask-googlemaps) (0.14.1)
    Requirement already satisfied: click>=2.0 in ./venv/lib/python3.5/site-packages (from flask->flask-googlemaps) (6.7)
    Requirement already satisfied: MarkupSafe>=0.23 in ./venv/lib/python3.5/site-packages (from Jinja2>=2.4->flask->flask-googlemaps) (1.0)
    flask-sqlalchemy 2.3.2 has requirement Flask>=0.10, but you'll have flask GoogleMaps which is incompatible.
    Installing collected packages: flask-googlemaps
    Successfully installed flask-googlemaps
    

    Diz que foi instalado com sucesso, mas na verdade não instala.

    opened by math77 5
  • Question: large dataset loading.

    Question: large dataset loading.

    Hey! I am using Flask-googleMaps for a NASA Space Apps Challenge and its been working great so far, thanks for making it! I have hit one issue I was hoping to pick your mind about and see if you have a solution.

    I am tring to render over 20k +/- circles on the map to show wildfires detected by satellite. I believe I implemented FGM properly but it takes forever to load. I think this is because of the very large dataset I am loading.

    Do you have any ideas for ways that I can either stream the circles in over time or something else that will work to load them?

    question 
    opened by osteth 5
  • Create a marker click listener for the map

    Create a marker click listener for the map

    I changed init.py and gmapjs.html in order to add functionality for a click listener to the marker. I fixed up the code as well to include the missing comma in file gmapjs.html in line 35 causing users to not see the map loaded up. I also added a property called {{gmap.varname}}_clickedMarker to the map in order to see the lat and lng of the last clicked marker.

    opened by gferioli0418 4
  • Mixed content error http vs https

    Mixed content error http vs https

    Hi,

    I have a problem when I load my site with https protocol, and the script (gmaps) loads over http.

    The message is the following: was loaded over HTTPS, but requested an insecure script 'http://maps.googleapis.com/maps/api/js?sensor=false'. This request has been blocked; the content must be served over HTTPS.

    Thx,

    opened by joanbales 4
  • Bad setup.py in 0.2.5

    Bad setup.py in 0.2.5

    0.2.4 is fine, regression occurs at 0.2.5

    Repro is easy:

    pip install -v flask-googlemaps
    

    Tidbit you're interested in is

    Installing collected packages: Werkzeug, MarkupSafe, Jinja2, click, itsdangerous, flask, flask-googlemaps
    
      Compiling /private/var/folders/2h/0dr8jftd1916yq_lp40__wzh0000gn/T/pip-build-avapA_/Jinja2/jinja2/asyncfilters.py ...
        File "/private/var/folders/2h/0dr8jftd1916yq_lp40__wzh0000gn/T/pip-build-avapA_/Jinja2/jinja2/asyncfilters.py", line 7
          async def auto_to_seq(value):
                  ^
      SyntaxError: invalid syntax
    
      Compiling /private/var/folders/2h/0dr8jftd1916yq_lp40__wzh0000gn/T/pip-build-avapA_/Jinja2/jinja2/asyncsupport.py ...
        File "/private/var/folders/2h/0dr8jftd1916yq_lp40__wzh0000gn/T/pip-build-avapA_/Jinja2/jinja2/asyncsupport.py", line 22
          async def concat_async(async_gen):
                  ^
      SyntaxError: invalid syntax
    

    Impact to user is when you do pip freeze it won't show Flask-GoogleMaps==0.2.5

    The error is coming from Jinja but pip install Flask still causes Flask to show up in pip freeze, so something is wrong with the setup.py

    opened by wontonst 3
  • [bug] All the described ways of showing a map in this repo don't work

    [bug] All the described ways of showing a map in this repo don't work

    Describe the bug A clear and concise description of what the bug is.

    All the described ways of showing a map in this repo don't work.

    To Reproduce Steps to reproduce the behavior:

    1. Having the following folder structure
    # /path/
    # ...../folder/...
    ├── README.md
    ├── __pycache__
    │   └── app.cpython-310.pyc
    ├── app.py
    ├── static
    └── templates
        └── example.html
    
    1. Having the following config files:
    Config files

    /path/.env

    Your .env content here
    

    and

    /path/settings.toml

    [default]
    
    1. Having the following app code:
      from flask import Flask, render_template
      from flask_googlemaps import GoogleMaps, Map
      
      app = Flask(__name__, template_folder=".")
      GoogleMaps(app)
      
      
      @app.route("/")
      def mapview():
          # creating a map in the view
          mymap = Map(
              identifier="view-side",
              lat=37.4419,
              lng=-122.1419,
              markers=[(37.4419, -122.1419)],
          )
          sndmap = Map(
              identifier="sndmap",
              lat=37.4419,
              lng=-122.1419,
              markers=[
                  {
                      'icon': 'http://maps.google.com/mapfiles/ms/icons/green-dot.png',
                      'lat': 37.4419,
                      'lng': -122.1419,
                      'infobox': "<b>Hello World</b>",
                  },
                  {
                      'icon': 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png',
                      'lat': 37.4300,
                      'lng': -122.1400,
                      'infobox': "<b>Hello World from other place</b>",
                  },
              ],
          )
          return render_template('/templates/example.html', mymap=mymap, sndmap=sndmap)
      
      
      if __name__ == "__main__":
          app.run(debug=True)
    
    
    1. Executing under the following environment

    flask run, pycharm run, ...

    Expected behavior A clear and concise description of what you expected to happen.

    Debug output

     * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
     * Restarting with watchdog (fsevents)
     * Debugger is active!
     * Debugger PIN: 119-826-731
    127.0.0.1 - - [02/May/2022 23:59:41] "GET / HTTP/1.1" 200 -
    127.0.0.1 - - [02/May/2022 23:59:43] "GET / HTTP/1.1" 200 
    

    Environment (please complete the following information):

    • OS: macOS Monterey 12.3.1

    Additional context

    example.html:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
    {{googlemap("sndmap", lat=0.23234234, lng=-0.234234234, markers=[(0.12, -0.45345)])}}
    </body>
    </html>
    

    s

    bug duplicate 
    opened by ghost 2
  • Prevent cluster at zoom level

    Prevent cluster at zoom level

    I have a map populated very densely with markers. Zoomed all the way in it is still clustering. Is it possible to prevent clustering at a zoom level or lower?

    question 
    opened by d0ngl3md 0
  • Release the latest version of the library to pypi

    Release the latest version of the library to pypi

    Hello, as the title says the latest version of the library is not on pypi and cannot be installed with pip. The latest version on there has a bug in gmapjs.html (on line 41 a comma is missing). I would be really thankful if you release it on pypi as I am trying to deploy an app with this library on heroku. Thanks!

    question 
    opened by veselin-angelov 3
  • [bug]Maps not loading to page

    [bug]Maps not loading to page

    I can't get the example maps to load to the page 'example.html'. When I go to my API metrics page on the Google Cloud Platform the number of calls to my API is not changing.

    I have tested my API key with a standard JS request and it is increasing and therefore the key is working.

    I have the following code on my app.py and my 'example.html' is exactly as is given in the repo front page.

    Any ideas? Feedback is greatly appreciated.

    from flask import Flask, render_template
    from flask_googlemaps import GoogleMaps
    from flask_googlemaps import Map
    
    app = Flask(__name__)
    app.config['GOOGLEMAPS_KEY'] = "my_API_key"
    GoogleMaps(app, key="my_API_key")
    
    @app.route("/")
    def mapview():
        # creating a map in the view
        mymap = Map(
            identifier="view-side",
            lat=37.4419,
            lng=-122.1419,
            markers=[(37.4419, -122.1419)]
        )
        sndmap = Map(
            identifier="sndmap",
            lat=37.4419,
            lng=-122.1419,
            markers=[
              {
                 'icon': 'http://maps.google.com/mapfiles/ms/icons/green-dot.png',
                 'lat': 37.4419,
                 'lng': -122.1419,
                 'infobox': "<b>Hello World</b>"
              },
              {
                 'icon': 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png',
                 'lat': 37.4300,
                 'lng': -122.1400,
                 'infobox': "<b>Hello World from other place</b>"
              }
            ]
        )
        return render_template('example.html', mymap=mymap, sndmap=sndmap)
    
    if __name__ == "__main__":
        app.run(debug=True)
    
    bug 
    opened by phukeo 10
  • (index):49 Uncaught SyntaxError: Unexpected identifier

    (index):49 Uncaught SyntaxError: Unexpected identifier

    When run the examples i get the following error: (index):49 Uncaught SyntaxError: Unexpected identifier, in the last line of following code:

    gmap = new google.maps.Map(
            document.getElementById('gmap'), {
                center: new google.maps.LatLng(37.4419, -122.1419),
                zoom: 13,
                mapTypeId: google.maps.MapTypeId.ROADMAP,
                zoomControl: true,
                mapTypeControl: true,
                scaleControl: true,
                streetViewControl: true,
                rotateControl: true,
                scrollwheel: true,
                fullscreenControl: true
                styles: "height:500px;width:800px;margin:0;"
            });
    

    Looks like he needs the comma at the end of the next line of code. " fullscreenControl: true".

    Thanks a lot. DTapia.

    bug 
    opened by DTHerrera 6
  • Add a marker label

    Add a marker label

    Hello, I cannot figure out how to add a label on my marker as here Is this possible?

    I tried adding an icon property but with no results

    icon = {
            'path': 'M 0,0 C -2,-20 -10,-22 -10,-30 A 10,10 0 1,1 10,-30 C 10,-22 2,-20 0,0 z M -2,-30 a 2,2 0 1,1 4,0 2,2 0 1,1 -4,0',
            'title': 'Mytitle,
            'fillColor': '#000',
            'strokeColor': '#000',
            'strokeWeight': 1,
            'scale': 1,
            'label': 'Mylabel',
            'labelOrigin': {'x': 10, 'y': 10}
    }
    

    ANy help would be much appreciated. Thank you for this great extension :)

    question 
    opened by harisbal 0
Releases(4.1.1.2)
Owner
Flask Extensions
A curated list (and repos) of Flask-Extensions
Flask Extensions
Code for "Unsupervised Layered Image Decomposition into Object Prototypes" paper

DTI-Sprites Pytorch implementation of "Unsupervised Layered Image Decomposition into Object Prototypes" paper Check out our paper and webpage for deta

40 Dec 22, 2022
CARL provides highly configurable contextual extensions to several well-known RL environments.

CARL (context adaptive RL) provides highly configurable contextual extensions to several well-known RL environments.

AutoML-Freiburg-Hannover 51 Dec 28, 2022
Minimal diffusion models - Minimal code and simple experiments to play with Denoising Diffusion Probabilistic Models (DDPMs)

Minimal code and simple experiments to play with Denoising Diffusion Probabilist

Rithesh Kumar 16 Oct 06, 2022
Implementation of Hourglass Transformer, in Pytorch, from Google and OpenAI

Hourglass Transformer - Pytorch (wip) Implementation of Hourglass Transformer, in Pytorch. It will also contain some of my own ideas about how to make

Phil Wang 61 Dec 25, 2022
Pytorch implementation for Patient Knowledge Distillation for BERT Model Compression

Patient Knowledge Distillation for BERT Model Compression Knowledge distillation for BERT model Installation Run command below to install the environm

Siqi 180 Dec 19, 2022
Boosted CVaR Classification (NeurIPS 2021)

Boosted CVaR Classification Runtian Zhai, Chen Dan, Arun Sai Suggala, Zico Kolter, Pradeep Ravikumar NeurIPS 2021 Table of Contents Quick Start Train

Runtian Zhai 4 Feb 15, 2022
Code repository for the paper "Doubly-Trained Adversarial Data Augmentation for Neural Machine Translation" with instructions to reproduce the results.

Doubly Trained Neural Machine Translation System for Adversarial Attack and Data Augmentation Languages Experimented: Data Overview: Source Target Tra

Steven Tan 1 Aug 18, 2022
CVPRW 2021: How to calibrate your event camera

E2Calib: How to Calibrate Your Event Camera This repository contains code that implements video reconstruction from event data for calibration as desc

Robotics and Perception Group 104 Nov 16, 2022
Official implementation of the article "Unsupervised JPEG Domain Adaptation For Practical Digital Forensics"

Unsupervised JPEG Domain Adaptation for Practical Digital Image Forensics @WIFS2021 (Montpellier, France) Rony Abecidan, Vincent Itier, Jeremie Boulan

Rony Abecidan 6 Jan 06, 2023
PyTorch Implementation of Fully Convolutional Networks. (Training code to reproduce the original result is available.)

pytorch-fcn PyTorch implementation of Fully Convolutional Networks. Requirements pytorch = 0.2.0 torchvision = 0.1.8 fcn = 6.1.5 Pillow scipy tqdm

Kentaro Wada 1.6k Jan 07, 2023
Ludwig is a toolbox that allows to train and evaluate deep learning models without the need to write code.

Translated in 🇰🇷 Korean/ Ludwig is a toolbox that allows users to train and test deep learning models without the need to write code. It is built on

Ludwig 8.7k Jan 05, 2023
Tensorflow solution of NER task Using BiLSTM-CRF model with Google BERT Fine-tuning And private Server services

Tensorflow solution of NER task Using BiLSTM-CRF model with Google BERT Fine-tuning

MaCan 4.2k Dec 29, 2022
Multi-Agent Reinforcement Learning for Active Voltage Control on Power Distribution Networks (MAPDN)

Multi-Agent Reinforcement Learning for Active Voltage Control on Power Distribution Networks (MAPDN) This is the implementation of the paper Multi-Age

Future Power Networks 83 Jan 06, 2023
Nsdf: A mesh SDF with just some code we can directly paste into our raymarcher

nsdf Representing SDFs of arbitrary meshes has been a bit tricky so far. Express

Jan Ivanecky 5 Feb 18, 2022
Source code for the paper "Periodic Traveling Waves in an Integro-Difference Equation With Non-Monotonic Growth and Strong Allee Effect"

Source code for the paper "Periodic Traveling Waves in an Integro-Difference Equation With Non-Monotonic Growth and Strong Allee Effect" by Michael Ne

M Nestor 1 Apr 19, 2022
Project repo for Learning Category-Specific Mesh Reconstruction from Image Collections

Learning Category-Specific Mesh Reconstruction from Image Collections Angjoo Kanazawa*, Shubham Tulsiani*, Alexei A. Efros, Jitendra Malik University

438 Dec 22, 2022
AutoVideo: An Automated Video Action Recognition System

AutoVideo is a system for automated video analysis. It is developed based on D3M infrastructure, which describes machine learning with generic pipeline languages. Currently, it focuses on video actio

Data Analytics Lab at Texas A&M University 267 Dec 17, 2022
An Implementation of Fully Convolutional Networks in Tensorflow.

Update An example on how to integrate this code into your own semantic segmentation pipeline can be found in my KittiSeg project repository. tensorflo

Marvin Teichmann 1.1k Dec 12, 2022
PointPillars inference with TensorRT

A project demonstrating how to use CUDA-PointPillars to deal with cloud points data from lidar.

NVIDIA AI IOT 315 Dec 31, 2022
A task-agnostic vision-language architecture as a step towards General Purpose Vision

Towards General Purpose Vision Systems By Tanmay Gupta, Amita Kamath, Aniruddha Kembhavi, and Derek Hoiem Overview Welcome to the official code base f

AI2 79 Dec 23, 2022