Search

Showing posts with label Photography. Show all posts
Showing posts with label Photography. Show all posts

Sunday, January 19, 2020

Chobi - Face Detection Based Static Image Gallery Generator

Over the holidays I created a simple static photo gallery generator that I named chobi. The sources are in https://github.com/abhinababasu/chobi.

Given a source folder of photos, chobi will generate a destination folder containing the original photos, generated thumbnails, css stylesheets, scripts and html files which constitute a website displaying those photos as follows


The Problem

While building chobi and also when I was looking into similar online tools, I kept hitting a major issue and that prompted further work and this post.

You see thumbnail generation from image has a major problem. I needed the gallery generator to create square thumbnails for the image strip shown at the bottom of the page. However, the generated thumbnails would simply be either from the center or some other arbitrary location. This meant that the thumbnails would cut off at weird places.

Consider the following image.

If I create a thumbnail from a tool without knowing where the face is in the image, it will generate something like
Obviously that doesn't work. So using my vanilla generator I got a website with all sorts of similar head chopped off thumbnails (marked in Red)


The Solution

Chobi uses face-detection to ensure that does not happen and the face is always fully present in the generated thumbnail. Consider the same thumbnail as above but now with face-detection

Another example of an original image and then generated thumbnail first without and then with face-detection.


With this face-detection plugged in chobi generates a much better web-site, with almost no photo cropped where it shouldn't be.

Sources

  1. Chobi sources are at https://github.com/abhinababasu/chobi
  2. It uses the face-detected thumbnail generator which I wrote at https://github.com/abhinababasu/facethumbnail
  3. That is in turn is based out of a face detection library pigo written fully in go

Sample

Checkout a gallery build using chobi at 

Monday, January 06, 2020

Chobi - A static photo gallery generator



I love using Microsoft Todo and before taking time off in December I create a holiday todo list. I tend to be at home with the family and do bunch of projects around. I try to ensure that I am not doing only work related projects during that time, so put in a ceiling of half a week for coding related stuff. Other Todos generally involves carpentry, DIY home projects, yardwork, cleaning etc.

One of the projects was to update my online photo gallery. Now being a programmer I made it way more complicated than I should've. I decided to code up a minimalistic program to generate static photogallery out of folders of images I export out of Adobe Lightroom. As I mentioned above one of the requirement was to finish it in around 3 days.

I am happy to share that I have the project done and the sources are available at https://github.com/abhinababasu/chobi. It took me about 3 days and most of the time was spent figuring out UI stuff which I rarely do and pondering about which photos to put in the gallery.

The code is in go and it does the following

  1. It iterates through a folder of images (sub-dir not supported yet) and copies the images to a destination
  2. Also places thumbnails (configurable size) into the destination
  3. There is a template html that it modifies to display those images
  4. It also uses some client side script to 
    1. Randomize the image order
    2. Show a carousel of the images
    3. A thumbnail gallery at the bottom
    4. Automated photo rotation
Here's a screenshot of the sample landscape gallery.


Since this was very time-bound project there are tons to stuff left to do, some basic bugs abound as well. But I decided to timeout on the effort for now and revisit again hopefully in the spring.

Sunday, July 03, 2011

Palouse Photography Trip

From Wikipedia, “The Palouse is a region of the northwestern United States, encompassing parts of southeastern Washington, north central Idaho and, in some definitions, extending south into northeast Oregon. It is a major agricultural area, primarily producing wheat and legumes”. But that doesn’t really tell you what Palouse is :). My daughter named it more aptly as Greenland and the photo below is explanatory.

 

It’s a beautiful land of rolling green (or Yellow based on season) hills and a photographer’s delight. It’s one of the most beautiful landscape I have ever seen. It’s easily worth the 5-6 hour drive from Western Washington cities like Seattle. The receptionist at the hotel we stayed in said that they’ve had photographers from as far as Australia visit them.

Last week (6/16/2011) I went on a 2 day trip to the Palouse area in Eastern Washington. The primary plan was to just drive around and take some great shots. This post captures the quick details about what went right, what went wrong and some tips about how to make the trip family friendly.

Good Time to Visit

I asked around and checked Flickr for Palouse photos from different times of the year. I think early to mid June is pretty good time to see the excellent green colors in the field. August is great for capturing the golden yellow pre-harvest colors.

Where to Go

My agenda was to cover Palouse water falls, the Colfax-Steptoe-Garfield-Palouse-Pullman pentagon. I took the following route. Click around to see the main routes travelled.

image

On the Way

Palouse waterfallOn the way (and back) you should stop at the great I90 rest areas. They are spread around every 30-40miles and there are blue signs on the way indicating where they are (e.g. Rest Area Next Right) and how far the next one is (Next Rest Area 34 miles). Many of these serve free free hot coffee and cookies and all of them have rest rooms. After gorging on the super hot coffee and home made cookies made by dear old ladies who run these places, do remember to generously donate in the donation boxes. We carried our camping stove and had some nice warm noddle soup for lunch at the rest area.

Palouse waterfall, furry friendWe then stopped at the Palouse falls (B in the map). As with most remote sites with dirt roads, the GPS picked up some really bad roads for the routing (Nunamaker Rd). Avoid this road and follow the signs and the route showed in the map which is to avoid Nunamaker Rd and continue straight on 260 and take a left onto 261. This goes into the Palouse Falls State Park. The Park has around 10 campsites and has a huge waterfall plummeting down 190ft. Covered picnic shelter with tables, water and barbeque pits are available here. The camp sites are first come only and there is a resident host as well. There is water but no power hookup at the sites. There are some short hiking opportunities as well where you can hike 0.5 miles up towards the waterfall top. However, do note that the hiking routes have some points where there is significant exposure to heights and you gotta be very careful. There is also no safe way to descend to the bottom of the falls even though there seems to be some trails that go down.

There are a lot of cute Marmots and a lot of huge insects and snakes all around.

The Palouse

Palouse Old barnWe didn’t stay in the Falls area. Instead we went ahead to Colfax which is around an hour away. I really liked the Best Western Wheatland Inn at Colfax where we stayed. We paid around $110 for the night. It had a nice hot breakfast, good rooms with TV and a nice warm indoor swimming pool. I cared about these because my wife and kid would spend a lot of time indoors as I’d drive around on the dirt roads for the next day or so. Just opposite to the hotel was a store, Taco Bell, Subway and other eating joints. I have had other friends who stayed in Pullman (30mins south of Colfax) which has many more hotel options because it’s the house to Washington State University. However, I ‘d recommend staying in Colfax due to it’s proximity to Steptoe butte and other interesting areas.

Palouse from Steptoe ButteAfter checking in I went to the Steptoe Butte for the customary Sunset shot, which however was utterly ruined due to rains and clouds. Steptoe Butte is a very important geological feature and a must visit. So much so that other geological features of it’s type is called steptoes. Steptoe is a 400 million year old rock sticking up high over the rolling hills of Palouse. Amazing views of light and shadow on the Palouse and patterns of wheat harvest can be seen from top.

Post sunset I got back to the hotel. Next day morning I mainly drove around inside the Pentagon. Then came back for some lunch in the hotel. Then again after some driving around headed back via I90.

Palouse run down barnTo drive around the key thing to remember is that all state routes have almost no shoulders and no place to stop. So even if one route offers a good view, you cannot stop to photograph. Also the broken down barns are not really on the main routes. So you need to pick up the dirt roads and drive on them. These are gravel roads and cars skid a lot on them. So a 4x4 car is a good thing to have but not really mandatory. The route I mainly drove on is in the map linked above. However, they show the main route taken, you’d need to continually divert from them to get to the side roads as well.

  1. Palouse colors

Some nice roads to try

  1. Palouse Alboin Road. Get into the side roads for broken garages and barns
  2. I tried and really liked the Chief Kamiakin Park >Fugate Road > S Palouse River Rd. However,
  3. Hume Road (From SR 195 to Oaksdale)

The photographs at http://www.flickr.com/photos/abhinaba/sets/72157626870022427 are manually geocoded, so that should give an approximate idea on where they were taken.

The Way Back

We came back via a different route because we were already close to Oakesdale and were told that the road from there to I90 had some nice views. We took the Oakesdale > Thornton > St. John > Sprague > Seattle via I90 West route.

Palouse farming planesWe did make some stops on the way back. One was the scenic viewpoint just before crossing the Columbia river gorge. The other was the Ginkgo Petrified Forest State Park Visitor center. This is just after the gorge. It contains some fantastic samples of petrified tree trunks where Ginkgo trees have been transformed to rocks (silica) after being covered by lava flows some 15 million years back. Also from the interpretive center you can see the banks of the Columbia river. We had some fun counting the layers of Lava visible on the banks where each layer corresponds to a major lava-flow incident millions of years back.

Back Home

The trip was awesome and covered 400 million year old rocks, 15 million year old tree trucks, 3 month old crops and everything in between. I plan to go back again to capture the Golden hues of the pre-harvest crops soon.