Coder Social home page Coder Social logo

joeylitalien / ecsex46-submission Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 14.28 MB

Submission script for ECSE X46 / COMP 598 Realistic/Advanced Image Synthesis

Home Page: http://www.cim.mcgill.ca/~derek/ecse446.html

HTML 99.76% Python 0.24%
course assignments rendering

ecsex46-submission's Introduction

Submission script for Realistic/Advanced Image Synthesis

Requirements

The submission script relies on a few Python modules and the OpenEXR library. We provide instructions for Linux, macOS, and Windows, assuming you have access to Windows Subsystem for Linux (WSL) on Windows 10. If you have problems running the script, please email the TAs or see them at their office hours. Don't wait until the deadline to make sure this script works; test it beforehand!

Linux / WSL

To install OpenEXR and pip, run

sudo apt-get install python-pip libopenexr-dev zlib1g-dev

macOS

On macOS, you need to install Homebrew first in order to install OpenEXR.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install openexr
curl https://bootstrap.pypa.io/get-pip.py | python

You can verify that pip is correctly installed by typing pip --version in the command-line. To install the requirements for the tools, run

pip install --user -r requirements.txt

You can check that all packages have been installed by typing pip list.

Configuration file

Every assignment comes with a config.json file within the data directory of the basecode. Each field needs to be filled by the student, except the scene titles (renders/scene fields) which are already provided. Below is the sample config file to be modified.

{
  "firstlast": "John Doe",
  "id": 123456789,
  "assignment": 1,
  "course": 446,
  "renders": [
    { "scene": "Veach Ajar",
      "render": "renders/veach_ajar.exr"
    },
    { "scene": "Living room",
      "render": "renders/living_room.exr"
    },
    { "scene": "Bathroom",
      "render": "renders/bathroom.exr"
    }
  ]
}

Creating a submission

Once you are done generating all your images, make sure the paths in config.json are correct and simply run

python submit.py config.json

within the terminal. This script can take a few seconds to run depending on the tasks. Behind the curtains, submit.py essentially converts your OpenEXR images to PNG images, and then embeds them into an HTML template as base64 images. An horizontal slider is used to allow graders to easily compare your outputs with theirs (which you don't have access to, hence the broken link). Your student and assignment informations are parsed and put into an HTML file to be rendered by your browser.

The result is a standalone submission file a1_123456789.html containing all of your rendered images. Depending on the assignment, this file can be somewhat heavy since all your image data is contained within the file. Make sure the output is correct before submitting your assignment!

Submission example

To see a sample submission, have a look at sample.html. Running the script with the default configuration file should yield a new submission which is identical to it.

Converting from OpenEXR to PNG/JPG

An additional script is provided to convert a rendered image in OpenEXR format to PNG/JPG format. This code is part of submit.py but a standalone version is provided, if needed. To convert to PNG, run

python convert.py input.exr output.png

The output can also be a JPEG image; the script will automatically detect the output format.

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.