When a programmer held a photo contest

go.fly
3 min readMay 28, 2022

--

Background story

Shanghai lockdown for 2 month, and 80% of developers in my Company, about 1500 people work in this big city. So our company want to hold a special photo contest on this topic.

Fortunately, I became the organizer of this event, and in two months, this event got more than 4000 submissions, and finally, I picked 20 best ones to create the final video, and these photographers will receive a gift worth $200.

How to create the photo contest website?

At first, I want to create a simple website for uploading photos, then I found there are lots of open source photo contest git repo on the internet. However, if I want to use these open source code in the enterprise network, I need to pass the company security audit first. So at last, I just used Microsoft forums service, it can create simple free style web forums, which support upload any kinds of file to Microsoft cloud(both photo & video are supported).

Sample page

And in the response page, organizer can export all of the response into a XLSX file, pictures can also downloaded from Microsoft cloud.

How to validate so many photos

Forums.microsoft.com is a great tool, it can filter jpeg, png, bmp file types, however, it lacks some basic features for photo contest:

  1. Uploaded photo needs to be high resolution. For example, at least 1000 pixels at the short side, but no more than 10000 pixel at the long side.
  2. No water marks
  3. Shoot at the shanghai lockdown period
  4. Every photo needs a title and a short description

Be a software engineer, point 1, 3, 4 can be easily checked by photo exif data, if you don’t know exif, please refer to this wiki:

In the mac, you can easily view these data when you press CMD+i:

(The first row is the image size, second row is the camera manufacturer, the last two rows are GPS locations in Chinese)

I used python PIL to validate image size, shoot time, here are the core functions:

For photo title and description, they can be read from the response xlsx file, the data looks like:

email address & photo URL are masked out

Using python pandas can read xlsx file into data frame, then check the description column line by line(Because descriptions are in Chinese, 无 == None, means description is empty)

For the watermark, maybe need to use openCV to detect, however, this part is not completed(I may write another article about basic video processing).

Final words

After all of these simple filtering, only 45% of the submission passed the basic criteria, I think most of colleague even not fully read the contest description…

Finally, manual check is still needed. So far, AI still can not judge good picture and bad picture, some guys sent pictures about their home made Chinese food, some guys sent the moments of their indoor training, and some guys just want to share their cute kids. Maybe I should set some photo categories at first, however, no one knows what people will share at last, and it’s the first time Shanghai lockdown for two months.

--

--

go.fly
go.fly

Written by go.fly

Drone photographer, traveler, hacker

No responses yet