Giter Club home page Giter Club logo

lucyparsons / openoversight Goto Github PK

View Code? Open in Web Editor NEW
231.0 28.0 77.0 30.96 MB

Police oversight and accountability through public data ๐Ÿ‘ฎ

Home Page: https://openoversight.com

License: GNU General Public License v3.0

Python 50.07% JavaScript 19.89% CSS 2.83% HTML 11.60% Mako 0.03% Makefile 0.21% Dockerfile 0.15% Shell 0.03% SCSS 15.20%
police-officers database foia photographs digital-galleries city police police-misconduct

openoversight's Introduction

OpenOversight Coverage Status Documentation Status Join the chat at https://gitter.im/OpenOversight/Lobby

OpenOversight is a Lucy Parsons Labs project to improve law enforcement accountability through public and crowdsourced data. We maintain a database of officer demographic information and provide digital galleries of photographs. This is done to help people identify law enforcement officers for filing complaints and in order for the public to see work-related information about law enforcement officers that interact with the public.

This project is written and maintained by @lucyparsonslabs with collaboration, partnerships, and contributions welcome. If you would like to contribute code or documentation, please see our contributing guide and code of conduct. If you prefer to contribute in other ways, please submit images to our platform or talk to us about how to help sort and tag images. This project is live, and we are currently soliciting photographs to add to the database.

Note to Law Enforcement

Please contact our legal representation with requests, questions, or concerns of a legal nature by emailing [email protected].

Issues

Please use our issue tracker to submit issues or suggestions.

Developer Quickstart

Make sure you have Docker installed and then:

git clone https://github.com/lucyparsons/OpenOversight.git
cd OpenOversight
make dev

And open http://localhost:3000 in your favorite browser!

If you need to log in, use the auto-generated test account credentials:

Email: [email protected]
Password: testtest

Please see CONTRIB.md for the full developer setup instructions.

Documentation Quickstart

pip install -r dev-requirements.txt
make docs

Deployment

Please see the DEPLOY.md file for deployment instructions.

What data do I need to set up OpenOversight in my city?

  • Officer roster/assignment/demographic information: You can often acquire a huge amount of information through FOIA:
    • Roster of all police officers (names, badge numbers)
    • Badge/star number history (if badge/star numbers change upon promotion)
    • Demographic information - race, gender, etc.
    • Assignments - what bureau, precinct/division and/or beat are they assigned to? When has this changed? Clear images of officers: Scrape through social media (as we have done) and/or solicit submissions. Encourage submissions with the badge number or name in frame such that it can be used to establish the face of the officer in the roster. After that point, new photos with a face matching the existing face in the database can be added to that officer's profile.

openoversight's People

Contributors

abandoned-prototype avatar aetherunbound avatar asabine avatar b-meson avatar brianmwaters avatar dependabot[bot] avatar dismantl avatar ebaxter avatar elimisteve avatar fritzdavenport avatar furfreemi avatar joshuaopolko avatar leifan89 avatar mceileen avatar michplunkett avatar mutantmonkey avatar nmanfred avatar parhamr avatar peculater avatar pierwill avatar r4v5 avatar redshiftzero avatar sarayourfriend avatar sea-kelp avatar shawnastewart avatar spraynard avatar ssempervirens avatar te-k avatar tmc avatar tomx4096 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openoversight's Issues

Add Facts / Figures page

Per our press person, we should add facts and figures to our webpage which will help demonstrate why there is a need to do this. For example, the sworn affidavit section should link to this statement source on CPD's website.

State law requires that any person making an allegation of misconduct against a Chicago Police Officer sign a sworn affidavit that certifies that the allegation is true and correct. If the person making the complaint did not actually witness the alleged conduct, they must certify that they believe that the facts in the allegation are true.

Illinois law (50 ILCS 725/3.8) requires that anyone filing a complaint against a sworn peace officer must have the complaint supported by a sworn affidavit.
Any person who knowingly files a false complaint may be subject to criminal charges or a civil suit. A person commits perjury when, under oath or affirmation, in a proceeding or in any other matter where by law such oath or affirmation is required, he makes a false statement, material to the issue or point in question, which he does not believe to be true. Perjury is a Class 3 felony.

Also, according to data from the Invisible Institute only 72% of complaints have an ID'ed officer in their older data set.

Exception when results set is empty

We are getting an error in the application from gunicorn when I submit the following query:
a white female commander aged 35-55. Mason and I suspect that this is because of an empty set being returned.

Oct 04 02:52:31 openoversight.lucyparsonslabs.com gunicorn[1353]: [2016-10-04 02:52:31,264] ERROR in app: Exception on /lineup [POST]
Oct 04 02:52:31 openoversight.lucyparsonslabs.com gunicorn[1353]: Traceback (most recent call last):
Oct 04 02:52:31 openoversight.lucyparsonslabs.com gunicorn[1353]: File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1988, in wsgi_app
Oct 04 02:52:31 openoversight.lucyparsonslabs.com gunicorn[1353]: response = self.full_dispatch_request()
Oct 04 02:52:31 openoversight.lucyparsonslabs.com gunicorn[1353]: File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1641, in full_dispatch_request
Oct 04 02:52:31 openoversight.lucyparsonslabs.com gunicorn[1353]: rv = self.handle_user_exception(e)
Oct 04 02:52:31 openoversight.lucyparsonslabs.com gunicorn[1353]: File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1544, in handle_user_exception
Oct 04 02:52:31 openoversight.lucyparsonslabs.com gunicorn[1353]: reraise(exc_type, exc_value, tb)
Oct 04 02:52:31 openoversight.lucyparsonslabs.com gunicorn[1353]: File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1639, in full_dispatch_request
Oct 04 02:52:31 openoversight.lucyparsonslabs.com gunicorn[1353]: rv = self.dispatch_request()
Oct 04 02:52:31 openoversight.lucyparsonslabs.com gunicorn[1353]: File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1625, in dispatch_request
Oct 04 02:52:31 openoversight.lucyparsonslabs.com gunicorn[1353]: return self.view_functionsrule.endpoint
Oct 04 02:52:31 openoversight.lucyparsonslabs.com gunicorn[1353]: File "/home/nginx/oovirtenv/OpenOversight/OpenOversight/app/views.py", line 59, in get_lineup
Oct 04 02:52:31 openoversight.lucyparsonslabs.com gunicorn[1353]: officer_images=officer_images)
Oct 04 02:52:31 openoversight.lucyparsonslabs.com gunicorn[1353]: UnboundLocalError: local variable 'officer_images' referenced before assignment

Store images on S3

We should be storing our images on S3 (not in the database). Right now I have the ~10k that I have collected on my local machine

Security Audit

We should do a basic penetration test and internal code audit so that we don't get hacked and can harden out application. This will also become more important once we fix #5 and if we have users logging in. I can lead this project.

Pagination

There are a lot of officers in CPD - which can make for slow queries as the app tries to get a photo for thousands of officers. Let's have the app show 10-50 at a time.

One-command deploys

Once we have migrations and a local dev environment, we'll want the ability to deploy this thing in a far more straightforward manner than we currently have. I'm open to suggestions; I'm thinking either a rake task that rsyncs things or a capistrano setup, but that's because most of my deployment orchestration experience is in Ruby. For all I know, there's a better solution here, and if so, we should find it and use it.

Visual guide to officer rank

We need a short guide on what each rank looks like on an officer's uniform. Can be done in a sidebar on the submission form template or on a separate page

CSS theme updates

Current theme is very grey. There are a few nice default bootstrap themes.

Automatic face detection

Do face detection automatically with images submitted by users and those that are scraped from social media

Let a user flag the "maybes" and review them

A user might look through the list and want to flag the N officers that look similar to the one that they interacted with. They should ideally be able to flag these officers, then return and review them to compare and see if they recognize the one.

Use location of incident to sort returned officer list

We can sort the returned list of officers by proximity, e.g. if the location of the incident is in district 11 we should display the officers assigned to district 11 first. Note that some officers do not have a unit assignment that corresponds to a particular part of the city as well as the fact that some officers may be assigned to one district but interacting with citizens in another district.

Automatic metadata stripping and malware sanitization

We got a request for stripping of metadata from some submitted images, but really we should just be doing this for all images. Potentially the only metadata to keep would be timestamp EXIF data that has when the image was taken (something we are trying to keep track of in the database), so we should grab that and dump the rest.

Add note about data issues

We should give people a contact address and inform them we're interested to know if there is something wrong with our data. Perhaps we can find out inaccuracies and correct them

DB Migrations

We like databases, but if we have a dev environment that isn't "work by connecting straight to prod", we're going to need to change them as we add new things. We should use something like flask-migrate to manage DB migrations as the project grows. This is separate from the snapshotting and access control configuration we'll need to do once this goes live.

Redaction of non-officer faces in images

We need to get rid of non-officer faces in the images to protect the privacy of citizens. We should incorporate redaction into our tagging app by enabling people to flag citizen faces that should be blocked out. Once a sufficient number of tags from trustworthy users for a given face are present we can blank out that area in the image (this is to prevent officers from going in and blanking out officer faces). We'll preserve the raw hashes of images generated upon upload in #5.

Automate scraping

We've been writing code to scrape social media, but we should definitely automate this more:

  • Each scraper should run every day and automatically upload images into the raw_images table for volunteers to tag
  • Each scraper should get only the images that have been put up since the last time we scraped
  • Each scraper should be putting the timestamps into the database. We want to keep track of how old each photograph is if possible (currently, all photographs in the database do have timestamps tracking when they were inserted).

Integration tests

We need some integration tests to check the end-to-end functionality of our webapp. Should probably use selenium for this

Privacy Policy

Describe our privacy policy (we take your privacy very seriously!) in the webapp.

Do file uploads with WTForms

To enable users to SAFELY upload certain file formats. These uploads should go to S3 and then a row should be inserted into officers.raw_images.

Sort lineup by number of complaints

Suggestion by one of our lawyers: we could use the Citizen's police data project to sort the returned lineup by number of complaints. Those officers that have a history of misconduct are likely to reoffend and we might make it easier for people to find the offending officers by putting them at the top. This approach is similar to search engines putting the most popular sites near the top of the search results list.

Tagging feature

We want an application that displays submitted images that have not been tagged yet, which one can grab by select * from officers.raw_images where is_tagged = 'f'.

Then this application would allow people to click on a face and drag a box to select the cutout of the face - this is what will be stored in face_position in table faces and displayed in the digital lineup. Then next to each face, there should be two fields: one for name and one for badge number which the user should fill in one or both of. The user should be able to tag a single image multiple times.

Upon submission of the form, if there is one officer that matches the name or badge number then we add a row in table faces linking the officer_id with the img_id at face_position. If there is more than one officer (e.g. in the case of a surname that is very common or a badge number that has been reused) or if there are zero officers (e.g. in the case of a new officer that does not appear in our roster yet) we will need to manually review it.

Set up Travis and Coveralls

Set up travis and coveralls to run our tests. needs to be done once we make the repo public so we can get that free service

Mobile improvements

Current templates render poorly on mobile - make much more friendly for mobile interface (e.g. the navbar should collapse, etc.)

Can we use POD and body cameras for images?

We're looking for additional photographs of officers in public places for the database. It turns out there are lots of public cameras we might be able to use. Someone should try to FOIA for POD camera data from times and locations there are likely to be police officers in public spaces (e.g. during the day). Resolution might be an issue, but it's worth a shot, and they do have zoom capability so there might be some rubies and gems in there. Let me know if you want to do this - I have a list of the POD camera locations so you can pick a good one.

Input incident location with map

We want to take in information about where incidents occur so that eventually we can use officer allocation information to identify officers. For now as a placeholder, there are latitude and longitude fields in the 'Find an Officer Form' which are just decimal fields. We should replace these two fields with an inset map: users can just drop a pin on this inset map and then the lat/long of that position should be sent to the backend.

Database creation/Installation question

According to OpenOversight/database/readme.md the database can be created by running the script at OpenOversight/createdb.py. This script doesn't appear to exist at this location. I've run the one at OpenOversight/OpenOversight/createdb.py but it appears to expect an environmental variable PGPASS. I'm assuming there should be a initial script that reads the .pgpass file and sets the variable so it feels like a file may be missing at OpenOversight/createdb.py. Please advise. Thanks.

Implement `face_position`

I tagged a bunch of photos and manually made cutouts of the officer faces. In the future we should implement face_position to make cutouts on the fly of the faces.

Update CPD roster

The most recent "Date of Employment" in our current roster is "2015-12-14 00:00:00". Time to update! More broadly, this is something that we will need to do periodically to keep data fresh. Also, we might want to consider adding photographs and A&A sheets to the list of things to FOIA for this project (so that we have information about where an officer is assigned in the city - this is necessary for #12).

Dev Environment

If we want to develop with any amount of rigor, we should have a dev environment. This is probably (because I'm doing it, and I stick with the devils I know) going to be a vagrant box provisioned via puppet, with a helluva lot of rake magic. I'm also going to try to make this match the production schema with dummy values, but an actual migrations management system is also work we should do (in a separate issue).

Initial test suite

We should avoid nasty bugs by writing an initial test suite once we have vagrant setting up our local postgres database for testing

Use date of incident to select historical rank and assignment

For now in our queries we assume that the incident in question is recent - we should also include the incident date in the web form. Then we should select the right row in the assignments table such that we can select officers based on their rank and assignment at the time of the incident.

CONTRIB.md out failures for env variables

currently if you run echo "localhost:5432:openoversight-dev:openoversight:terriblepassword" > ~/.pgpass more than once, it will throw a "too many keys" value because it appends it to the pgpass file. I manually edited it and removed all but one lines and it worked fine after a soure ~/.bashrc so I know its the >> append redirect.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.