Sprint 2 Wiki - mas2g2/RJI-CS4320-Project GitHub Wiki

LINK TO WEB INTERFACE

View Images

Functional Requirements come from Ed McCain

Use Case 1

The user can upload images to the site

Functional Requirement 1: Uploading Images

The system can recognize .jpg and .JPG images Converts .JPG files to .jpg Directories and multiple files can be uploaded at once Files that a user has previously uploaded to server are deleted from the server and database before new photos are uploaded Open and closes database connection during this function The system should be able to access these images for processing A tuple is recorded in the database for each photo that stores the absolute path and user_id The system should return an error if the user tries to upload a non recognized file format

We removed the Category Selection Functional Requirement from Sprint 1, since it was too much to implement in one week.

Use Case 2

The user submitted images are sent to our image quality assessment neural network for rating

Functional Requirement 1: Rate Images

The uploaded images are used to run a shell command from python that executes the image quality assessment model in a docker container. The results for each photo are used to update the corresponding photo record in the database from image-quality-assessment/src/evaluator/predict.py file.

Use Case 3

The user shall be able to download photos

Functional Requirement 1: View Photo Details

Photos are passed to the display as a JSON array Array contains file path and aesthetic rating of each image The system will display the submitted images in a grid fashion on the photo gallery page after they have been rated by the neural net image assessment system Ratings are displayed in a modal for each images User can click on a button below each photo to see all info

Goal: display category tag read from exif data and add tag for each image rating

Functional Requirement 2: Download Photos

On large batches, more photos are dynamically loaded as the user scrolls further down the page By clicking on each photo, the user can download each photo individually

We have plans to add a download all button, we were not able to add it this week

User Case 4

The user will be able to go through the images that meet the minimum specified rating after they have been submitted and rated before the user chooses which images will be downloaded.

Functional Requirement 1: Display images

After the user submits the photos, the system will show all of the photos that were submitted along with the rating that the system gave them. This is done by querying the database for Photos uploaded by the logged-in user. The results are then passed to the user interface as json and displayed using jinja2 syntax

Functional Requirement 2: Set Minimum rating and Remove/Hide images that did not achieve minimum rating

The user will be able to specify a rating that each image must have, in an array of check boxes that the system will use to compare with every image’s quality rating The system will compare the rating that each image received with the rating that was specified by the user and it will hide images that failed to achieve the minimum rating. We send a post request to /getRating/ to get photos uploaded by the logged-in user that are rated above the set minimum.

ERD Diagram

alt text

Design Document

Sprint 2 Design Document

SQL Schema

mySQL Schema

Edited/New Files

  1. app.py

  2. Photo Gallery View

  3. Home Page

  4. Neural Net Directory

  5. Photo File Location

  6. JS file

  7. Stylesheet 1

  8. Stylesheet 2

Unit tests:

  1. Upload Images/folder function on homepage Click 'Upload Photos' button which appears in the homepage home.html, Try submitting no images, many images, none image files, corrupt images, etc. Reference Photo table in the database and the upload folder on the server to see how submissions are handled for good and bad inputs.

  2. Rating Images Run the shell command directly on the server to test how the image quality assessment network handles different images. Time individual file uploads and folder uploads. Reference the database to see if the Photo records are updated appropriately with the records.

  3. Download Images Click each image to see if a download option is given

  4. Filtering and sorting images by rating On the Photo Gallery page, specify a minimum rating and then see if the images that are received surpass the specified rating.

Technical Challenges

Trouble converting .JPG files to .jpg files, we installed Pillow. Accidentally, we tried converting .jpg files to .jpg which resulting in the creation of a directory. Trouble getting results form image quality assessment system. We tried getting output via a reference file. However, we could not access the output from within the docker image that the network was running in. To solve this, we installed mysql-connecter through the docker config file and output the results to our database. We also had trouble accessing the updated photo records in Flask. We found out that this was because we were not managing our connections properly. Another ongoing issue is that the imported model we are using has not been trained on football images before and rates them all similarly. We will try to re-train the model in the future. We also had problems passing the Photo records info to the user interface. This was because we were using json.dumps() and not subsequently following it with json.loads(). We also had trouble downloading images individually and multiple at a time. We found that the download attribute was not being set correctly on the elements and that solved the individual download issue. However, we are still working on multiple downloads at once.

Future Work

  1. Adding a tag with the rating to each photo.

  2. Providing the user with the option to put "keep" or "toss" tags on each image and use this in a supervised machine learning model

  3. Clean-up code base

  4. Implement more security features

Could not rate all 100 images as requested, since we have run out of space on our server and more space would cost more money.

We will look into freeing space this coming week.