Git Product home page Git Product logo

ajapaik-web's Introduction

Python application codecov

This is the open-sourced Django project code for https://ajapaik.ee/

Running locally

docker pull laurielias/ajapaik-web:python-3.8.10
cp ajapaik/ajapaik/settings/local.py.example ajapaik/ajapaik/settings/local.py
docker-compose up -d

Build it yourself and launch

python-3.8.10-dlib is just python:3.8.10 with dlib and its dependencies installed. (compiling takes many minutes otherwise)

docker pull laurielias/python-3.8.10-dlib
docker-compose up --build

Multi-Device Testing

BrowserStack

We use BrowserStack to test on a variety of devices and operating systems.

Restore data from a dump

CREATE DATABASE rephoto_production_20190511;
CREATE USER rephoto WITH ENCRYPTED PASSWORD '';
GRANT ALL PRIVILEGES ON DATABASE rephoto_production_20190511 TO rephoto;
psql -d rephoto_production_20190511 -U postgres < rephoto_20210426.schema.dump
# Data only, no integrity checks while loading it in, no privileges
pg_restore rephoto_20210426.sql -d rephoto_production_20190511 -a -x --disable-triggers -U postgres

Push new image

docker push laurielias/ajapaik-web:python-3.8.10

Debug the container

If need be override the entrypoint in docker-compose.yml to tail -f /dev/null or the like. (in case the current entrypoint crashes, for example)

docker exec -it ajapaik bash

Starting with a fresh DB, add a Django superuser

In the container:

python manage.py createsuperuser

Deploy on our server - currently still using old school supervisord + uwsgis

Make sure you have local.py (mostly secret Django settings) and client_secrets.json (Google credentials) in your project root. They will be mounted into the container on startup. Make sure the nginx on the host knows how to proxy traffic to this container. Also symlink the media directory (the one with all the photos) into your project root, same for the Postgres data directory. Push/pull images again to update.

docker-compose up -f docker-compose.dev.yml

Update Juks' Vanalinnad data

wget -r --no-parent -A empty.json,layers.xml http://vanalinnad.mooo.com/vector/places/
wget -r --no-parent -A jpg --reject-regex "(.*)\?(.*)" http://vanalinnad.mooo.com/raster/places/

Misc. running instructions

On your local machine cp local.py.example local.py to get a quick start.

Fix for 'django.contrib.gis.geos.error.GEOSException: Could not parse version info string "3.6.2-CAPI-1.10.2 4d2925d6"': https://stackoverflow.com/questions/18643998/geodjango-geosexception-error

Installing Postgres: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-18-04

May be of help: ALTER USER ajapaik WITH PASSWORD 'seekrit'; GRANT ALL PRIVILEGES ON DATABASE ajapaik TO ajapaik;

Ajapaik depends on Postgres PostGIS functionality, with a fresh-enough Postgres, installation should be easy: http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS23UbuntuPGSQL96Apt http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS24UbuntuPGSQL10Apt

You'll need your own local settings in ajapaik/settings/local.py. You should at least override or specify the following keys:

  • ADMINS
  • MANAGERS
  • DATABASES
  • SECRET_KEY
  • LOGGING
  • GOOGLE_API_KEY
  • GOOGLE_MAPS_API_KEY
  • GOOGLE_ANALYTICS_KEY
  • ALLOWED_HOSTS

Running tests

source venv/bin/activate
python manage.py test --settings=ajapaik.settings.test --nomigrations --keepdb

To-do list

  • TODO: command for regular stats exports
  • TODO: fix core dump ageitgey/face_recognition#11
  • TODO: automate stats queries or at least document them better (should be possible with a Google Sheets API key?)
  • TODO: try if integrating Solr tighter will help search (the current solution where everything that matches 'Tartu' is retrieved into an array of IDs no longer performs)
  • TODO: implement this answer for keeps https://stackoverflow.com/questions/18643998/geodjango-geosexception-error
  • TODO: automate regular DB, media/uploads, media/videos backups
  • TODO: fix # noqa as much as possible (some Django quirks will always annoy flake8 though)
  • TODO: replace face_recognition with something else since it requires the horrendous dlib
  • TODO: don't install test/lint requirements in production Docker

ajapaik-web's People

Contributors

abbe98 avatar ahtih avatar blimly avatar dependabot[bot] avatar hansmu avatar jaens avatar kristjanh avatar kristokuiv avatar lauriy avatar maerthaekkinen avatar marguslaak avatar maryu avatar puik avatar ralphleyga avatar sihaelov avatar tarmo888 avatar translatewiki avatar vadim-zabolotniy avatar zache-fi 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ajapaik-web's Issues

Consider using static translation files generated by Django-statici18n

Currently, every time a request is made to Ajapaik Web App, an JavaScript translations are being downloaded.
This naturally makes the site load slower and takes up more resources of the server.

It can be possible to generate static translation files which are only updated when needed, using https://github.com/zyegfryed/django-statici18n.

Of course for this to work properly, the generated files would either make use of ETags or have some sort a hash in the name of the file.
This is how the browser is forced to fetch new content currently. ETags are used for images. Hash is used in static files (js,css,etc)

fix IIIF icon in toolbar

IIIF icon is missing – was linked as URL, need to save to our own assets (as it is not a material design font object)

visual toolbox for editing comments

Adding a standard visual toolbox for commenting (currently only markup editing possible) to make it easier for users to format their comments, add links, images.

display both title and description

Currently in gallery view (see) we display the beginning of the description and when opening the picture only title in shown.
We should show both. And we can have multiple descriptions (different types of descriptions in Muis.ee).

Should we add some separator/identificator for the text as well?
2 lines with line break might look odd. Especially if it happens that the content is nearly identical.

Perhaps one option is also to check if one or the other contains the first one. If there is an exact match, then show the longer one.

"suggestion has been submitted for this picture" needs proper plural support

There are two strings:

  • "1 suggestion has been submitted for this picture. Add yours!"
  • "suggestions have been submitted for this picture. Add yours!"

It looks like there are for different quantities. It would be much better to have proper plural support, because not all languages put the number in the beginning of the sentences.

advanced commenting system

Background:
Until early 2017 Ajapaik platform was using Facebook Comment for commenting as it was easiest and quickest to implement in the beginning, but commenting was not used much and we wanted to get rid of the FB user limitation, so we implemented Ajapaik's own commenting system in February 2017 based on django-contrib-comments and django-comments-xtd.

Plan:
Implementing different comment types:

  • general comments
  • location/geotagging comments
  • dating commentswe already have separate freetext comments for datings, it should be intergrated with the commenting system
  • comments about details with IIIF/Mirador? similar to how Pastvu has it (an example with detail comments on an image on Pastvu)
  • comments about rephotos

Comments should be in one thread with type labels, geotag comment is connected to a submitted geotag (need for comment field in the geotagging interface), dating comment to a submitted date etc.

additions to CSV upload

  • Tutorial and sample spreadsheet
  • Some columns (source, persons) not obligatory
  • Pictures from URL

Add rephoto ratings

3 star – very exact rephotograph (not only camera angle but also other aspects)
2 – exact vantage point
1 – more or less accurate
flag – not suitable as rephoto

enhancements to image permalink page

Ajapaik's main entry points are image permalink pages (for instance https://ajapaik.ee/photo/73231/) that get shared. We need to have more content on permalink page for users to continue exploring content:

  • nearest images vertical film strip on the right hand side
  • other images from album when image has no geotag

In the future option to change between the two and other stuff

Competing person labeling suggestions

How shall we solve the need to show different suggestions made for same face?
All activity log that is planned anyway can be one (probably the easiest) option but we could display something in the face annotation dialogue too?

notification center (notifications about different interactions)

The general idea is making Ajapaik platform more social (more Facebook-like) by enabling more social interactions about the content of historical images and specific tasks on Ajapaik platform.

Different scenarios:

  1. For instance when different users suggest different location (geotag) for one image it is a case for discussion and the user who made the first suggestion should get a notification that somebody has suggested a different location, does the first geotagger agree with the new suggestion or does s/he want to defend her/his initial submission. Also the other users could be engaged in the discussion.
    Currently the suggestions by different users do not have equal weight but depend on the calculated trustworthiness of the users. Sometimes a very trustworthy user can also err and their wrong suggestions are hard to change by other users (especially if the corrector is a new user with little contribution record). We need better mechanisms to engage users in discussion.

  2. A user could subscribe to a specific album or area so that when images are added to these a notification is sent.

  3. Users get notifications for every interaction (comments, geotags, datings, favoriting) made with an image user has interacted with him/herself (favorited, geotagged, dated, commented). In the future user could select which interactions s/he wants to be notified about.

Ideally the notifications could be service workers so that users would get notifications even when not visiting the Ajapaik site directly but just when they are using their browser.

pkg-package==0.0.0

why can not install pkg-package==0.0.0 for me in CentOS6.5 ? Can you help me? thanks

Make person (album) editable

We need have a view for editing person information that's available for all contributors. The view should also display person photo(s).

Data model:

  • firstname
  • lastname
  • other names
  • gender
  • birth date (different granularity – only year, exact date, approximate date)
  • death date
  • is public figure
  • labels
  • external IDs (ID label & value: wikidata ID & Q...; other external ids)

Shall we have another table for external IDs url-patterns?

Probably also needed is option of locking person editing.

Logging all the edits (something wiki-like?).

activity log for every historic picture

Under every picture an activity log of all the events-interactions related to the picture (starting from curation). Example log for a picture in Civil War Photo Sleuth.
Automated events (massimport, face detection, duplicate detection) marked as made by Ajapaik.

Types of events should also have an icon indicating the event type (action icons).

Should we show point given for each individual action? I think why not.

In the future lets add sorting + filtering to log. Starting with simple log.


First line: Action type icon – User name
Second line: action content
Third line: action comment (see CWPS note)


varasem kirjeldus:

iga pildi all ajatemplitega logi, kus kajastuks kõik tegevused
nt
1.1.2019 Vahur lisas pildi albumitesse "See" ja "Too"
2.1.2019 Aivo kommentaar: "Pilt on peegelpildis"
3.1.2019 Siim keeras pildi peegelpilti
3.3.2019 Tõnu märkis pildi kaardile (eriti huvitav oleks, kui saaks vaadata eraldi, kuhu märgiti)


Activities to display in activity log

  • geotagging
  • dating
  • commenting
  • tagging age/gender
  • tagging a person (shall we distinguish between just adding to person album and marking-annotating person face?)
  • adding to an album
  • favoriting
  • deleting erroneous automatic face tag
  • drawing face rectangle
  • annotating an object
  • connecting with similar images (either manually or confirming, rejecting automatic suggestion) – should we also display which similarity type was confirmed?
  • adding rephoto
  • categorizing
  • transcribing
  • editing (rotate, flip)
  • actions through duplicates? meaning that if a duplicate image is geotagged we also display action to its duplicates? then we might have geotagging before adding specific picture to Ajapaik ;) ?? also then we should start summing the geotags for duplicates together etc.. – many aspects to still think about and then implement

redesigned geotagger + different geotagging modes

Different geotagging modes selectable from menu:

  • photographer's position (selected by default)
  • object
  • approximate location
  • aerial photograph

1. Photographer's position (cam-pos) geotagging (default mode):

  • by default photographer's position/view sector icon is in the center of the map (as in the current Ajapaik live-solution)
  • view sector is marked with dotted lines (state unspecified)
  • from the position marker (probably a small circle) a image center dotted line starts that goes to the border of map
  • image center line and view sector follow the mouse, on touchscreens tap fixes it (as currently)
  • both icon and map are draggable: when grabbing the icon the map is not moving, when dragging the map, the position icon stays where it was, in other words: only one thing moves at a time: either map or marker >> this needs testing!
  • click on the map fixes the direction of the view (azimuth), state changes: image center line becomes solid (not anymore dotted). New click on the map resets the direction (as currently), image center line state changes to dotted again.
  • wild idea about view angle: the view sector outer line (fragment of circle) is draggable, when dragging it closer to the cam-pos marker, the view sector becomes wider, when dragging farer the view sector becomes narrower, releasing the sector fixes the view sector, state changes: view sector side lines become solid (not dotted anymore). Single click on the view sector outer line resets the viewsector to unspecified (dotted lines)

2. Object geotagging

Object geotagging can be separate from cam-pos geotagging, either alternative or supplementary.
User can geotag the central object (most prominent, probably the main thing that was photographed) on the image and additional objects -- objects that are also on the image, but not main subject.
Idea: user can also click on the image (photograph, painting) on the object that s/he has geotagged on the map.
What about tagging multiple images at a time? >>


3. Approximate location (approx-loc) geotagging

Can be used together with object geotagging, but not with cam-pos geotagging.

Interface idea:
A fixed size dotted line circle on the map, user can drag and zoom the map to include right area.


4. Aerial image geotagging

User has to click on at least 3 objects/places on the map and on the image for georeferencing.


Other aspects

Map zoom:

  • in cam-pos geotagging mode zooms on cam-pos icon position
  • in object/aerial photograph geotagging mode zoom on mouse position
  • in approx-loc mode zooms on map center

Image zoom
IIIF

Image horizontal flip
As currently implemented, sends state to back-end.

Different base maps
OSM, GoogleMaps, historical maps, other WMS map services (Maa-amet)

Streetview
Toggle Streetview button that would open the Streetview in closest location to the cam-pos geotag, see example

Showing/hiding location suggestion by other users
Currently we only see the other suggestions on heatmap after the user has saved her location

Re-edit your suggestion after saving

Dating

Place search by text
Ideally text search should start when starting typing.

How much has place changed?
The question in the end of geotagging

Free commenting option

Last location/object option?

See other geotagged photos from the location in geotagger
For instance film strip in the lower part of the screen filtering based on the direction of the view...

Visual aid on photo
Marking the center of the photo


exact duplicate pictures clean-up (hashes, merging, re-direct)

We have instances of exact duplicate historic images – exactly the same picture (= image file) has been imported from some repositories several times (mostly from Muis.ee and Finna.fi).

  • we need to add hash calculation to all files
  • compare hashes (and source IDs or url)
  • perform merging of duplicate pictures and also merge all the activity to the remaining picture
  • have redirect from merged Ajapaik ID to the remaining

add new face annotation tutorial for adding image-level person label to specific face

Currently we have annotation tutorial ("Click (don't drag) to start drawing...") displayed on top of the picture when annotation is started from toolbar, tutorial disappears with mouseove.

We need a different tutorial when the tagging of a person is started (currently "Tag a face" from person label, needs to be renamed to "Tag the face") from the image-level person label (imported from Muis without connection to specific face).

Tutorial text:
Click the face of /person name/ and confirm it in the opening dialogue

Extra:
Also change needed in the person menu dialogue – "Draw and tag a face" > "Draw and tag the face"

search in map view

Currently there is no search functionality in the map view, but when the image density is very high it would be very practical, if a search could be performed only among the images on a current map so that on the map and in the picture panel only images corresponding to the search were kept.

The search box should be in the header.

user profile page

In order to add more social features to Ajapaik a user profile page is needed:

  • User name
  • tagline (optional)
  • general stats (when joined, how many geotags, rephotos, comments, curated images)
  • galleries with images geotagged/curated/dated/commented/favorited by user

location labels

Issue description unfinished...

Instead of geocoded city- or country-level center coordinate populate picture to location labels (instead of albums)

In map view indicate number of pictures from map area location without exact coordinates

  • auto-populate
  • location hierarchy? historic location units?

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.