Image Segmentation, Then and Now
Here is a compilation of recent advances in the field of image segmentation, which is a subfield of computer vision. Enjoy!
Claire Keane
sheepfilms

pixel skylines
Lint Roller? I Barely Know Her

JBB: An Artblog!

⁂
TVSTRANGERTHINGS
Misplaced Lens Cap
will byers stan first human second

if i look back, i am lost
tumblr dot com
🪼
Acquired Stardust

PR's Tumblrdome

Discoholic 🪩
let's talk about Bridgerton tea, my ask is open
Aqua Utopia|海の底で記憶を紡ぐ
wallacepolsom
seen from United States

seen from United States
seen from India

seen from United States
seen from India

seen from United States
seen from India
seen from United States
seen from United States
seen from United States
seen from United States
seen from United States

seen from India
seen from United States

seen from United States
seen from United States

seen from United States

seen from United States

seen from Malaysia
seen from United States
@shreyapandit
Image Segmentation, Then and Now
Here is a compilation of recent advances in the field of image segmentation, which is a subfield of computer vision. Enjoy!

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
I presented at ICCV 2019
I consider myself really lucky to be able to present our research on developing accessible computer vision systems for patients with neurodegenerative diseases at the Assistive Computer Vision and Robotics workshop at the International Conference on Computer Vision held in Seoul, South Korea. More to come soon! here is a link to our paper:
Public static factory methods: Why do we need them?
Using the class’ constructor is the most common way of instantiating a new instance of a class. Though it does seem like the most common and easiest way, is it the only one? Furthermore, is it the best approach? Today, let’s talk about another way of achieving this. Presenting Public Static Factory Methods.
What are public static factory methods?
A method inside the class performing work similar to a constructor, i.e. returning clients a new instance of the enclosing class. A typical example would look like:
public class MyClass{
public static MyClass getNewMyClassObject(){
if(somechecks){
final MyClass myClass = new MyClass();
return myClass;
}
//Other Methods
}
the pattern is somewhat intersecting to how we would declare a singleton, but it goes beyond that and can be applied to non-singleton class creation as well.
If its similar, why should I use it instead?
public static factory methods have their own pros and cons. Lets look at each of them one by one:
PROS:
You can have different factory methods that behave differently based on argument lists passed in and name them to reflect what kind of object it would return. We don’t have this flexibility with constructors, who are supposed to be named the same as the class, even if they take in different arguments
With PSF methods it is OPTIONAL to create a new instance or return a cached ones based on the context for example a Singleton would return the cached global css instance. With constructors you would always have to create a new object.
With PSF Methods, it is possible to Customise your return type. If my class returns a Shape Object , it can return Square, Triangle or Cone based on the call made. This would make sure the client receives the correct subclass. The advantage here being that I do not need to expose the implementation of the Square/Triangle/Cone class. All the client needs to know about is Shape. So I make my API more compact and cleaner.
CONS: What could be the possible disadvantages?
One possible issue would be that If my classes are private and accessed only through public static factory methods of an interface, it is impossible to subclass it for extension.
Conclusion:
In general, in my opinion, public static factory methods hold more advantages than disadvantages. even if we cannot subclass the non public classes returned by static methods, we can still utilise them as our class members, and achieve desired behaviour.
If you are reading this and have any other opinions/ feedback/ questions, please leave a comment and we can discuss. Thanks!
Why does my list change color while scrolling on some phones?
As we all know, developing an android app means supporting a lot of os versions depending on what is your choice of api levels.
A lot of times, while setting custom background colors for Android’s listview, developers can be faced with a weird issue wherein while scrolling the listview background changes unexpectedly, and lead to inconsistent behaviour across devices.
Digging deeper into it, there is a lot going behind the scenes than it seems. Android list view by default has a transparent background and in order to match it with the background color set, it will have to blend each of its child with the background upon redraw. This is a very costly operation during a scroll gesture since scrolling causes multiple redraws per second, and blending each would require reading back stuff from memory. In order not to incur such expenses, the listView reuses the cacheColorHint set on the listview, if the android:scrollingCache property is enabled for the listview (which it is by default). The cacheColorHint is set to the system default, which could vary from the color you used for the background! This causes the background color to be different when scrolling.
Hmm, so how to fix this? Two options: either disable the cacheColorHint by setting it to transparent(#00000000) or simply set it to the background color you chose.
Hope this helps!
Cheers
The ListView Trilogy, part 3
In the previous two blog posts, I had written about how to use an async task to download and making it context-aware. In this post will talk about small tricks we had employed in order to make the list view scroll and look good
1.Using the ViewHolder Pattern
The view holder pattern allows you to hold a reference to each widget in the listiew item, hence minimizes the repetitive calls to findViewById(id).
Suppose my list view item has an image and text box. The view holder will be a static class in our adapter and will have the list item as its members. static class ViewHolderItem { public TextView nameItem; public ImageView destinationImageItem; }
In the getView(int i, View convertView, ViewGroup viewGroup) override of our adapter, the convert view is essentially the recycled view. It is here that we use and initialize our view holder, as such:
@Override
public View getView(int i, View convertView, ViewGroup viewGroup) {
ViewHolderItem viewHolder;
if(convertView == null){
LayoutInflater inflater = context.getLayoutInflater();
convertView= inflater.inflate(R.layout.fare_specials_list_item, null, true);
viewHolder = new ViewHolderItem();
initializeViewHolder(convertView, viewHolder);
convertView.setTag(viewHolder);
}
else {
viewHolder = (ViewHolderItem) convertView.getTag();
}
FareSpecial fareSpecial = fareSpecials.get(i);
setDataForRowView(viewHolder, fareSpecial);
return convertView;
}
If the convertView already exists, we can get a handle to the view holder object and use that to update the list view item.
The initializeViewHolder(convertView, viewHolder) is responsible for assigning references for the view objects:
private void initializeViewHolder(View convertView, ViewHolderItem viewHolder) {
viewHolder.nameItem = (TextView) convertView.findViewById(R.id.name);
viewHolder.destinationImageItem = (ImageView) convertView.findViewById(R.id.destination_image);
}
The setDataForRowView is responsible for updating the list view:
private void setDataForRowView(ViewHolderItem viewHolder, FareSpecial fareSpecial) {
viewHolder.nameItem.setText(fareSpecial.getName());
//Same for image view
}
2. Disabling the default scroll and animation caches for the list view
The scrolling cache of a view is basically a cache where the list view internally stores the bitmap of the view to be rendered. Animation cache is a similar concept that is used to cache data while animations are being executed on the list view for example a scrolling action. Both these methods make rendering faster, but consumes a lot of memory. Hence, we disable both of these by default.
<ListView
android:id="@+id/list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:dividerHeight="17dp"
android:scrollbars="none"
android:scrollingCache="false"
android:animationCache="false"
android:footerDividersEnabled="false">
</ListView>
3. Setting view bounds
The images we were downloading, we each almost a quarter of a MB, and android was internally resizing them to get them into the aspect ratio of the device. Because of that the image height and width no longer matched that of the enclosing image view and we could see a white space above and below the image.
To solve this we had to apply both android:layout_height=“wrap_content”and android:adjustViewBounds=“true” which tells the view to adjust its bounds according to the size of it’s drawable.
Hope these tips help! Questions, comments and feedback appreciated! :)

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
AsyncTask, Under the hood
As discussed in the last post, An async task might be easy enough to implement, but under it’s hood it carries a lot of secrets as well. Let us take a look at what we need to be careful of while dealing with async tasks:
An async task is usually launched by an activity, and publishes results back to the UI thread, in context of an activity. Sometimes, we also explicitly pass the reference to the activity to my task, for doing something directly on the activity. For example, our task was defined as
public DownloadRemoteImageAsset(Activity activity, String subDir, Callback downloadCompleteCallback)
Now, if the user starts a background task, and does something that destroys the activity, for example, changes the orientation of the phone. The original activity gets destroyed to re-render possible layout changes, and we now hold a leaked reference to an activity that has been destroyed. Not only would this prevent it from being garbage collected, we will also end up publishing results to a leaked object. It would end up hogging application memory and leading to an OutOfMemoryException.
Level-1 Solution:
The simple solution in such cases is outlined as below:
-ideally to have a handle to the Async Task running.
- We can save the task handle on configuration changes using onRetainCustomNonConfigurationInstance. This method allows you to store objects of your choice under config changes. We also detach the activity from the task before saving it.
@Override
public Object onRetainCustomNonConfigurationInstance() {
myTask.detach();
return (myTask);
}
And the detach method of the task:
public void detach() {
if (myActivity() != null) {
this.myActivity = null;
}
Now in the onCreate , we can check and retrieve if an existing task was saved, using
task = (current_task == my_task ) ? (myTask) getLastCustomNonConfigurationInstance() : null;
- We can check and reattach activity context based on the above step:
if (task == null) {
myTaskObj = new myTask(this);
else
myTaskObj.attach(this);
This is an elegant solution to the above issue. But if you are using API level 13 onwards, you would realize that the onRetainCustomNonConfigurationInstance API is deprecated and the Android documentation recommends using setRetainInstanceState(true) for the fragment.
The problem we had with the above fix was that our fragment was nested under 2 levels of hierarchy and secondly, we were putting that on a backstack. setRetainInstanceState works only for activities not on back stack.
So, the solution we finally came at is destroying the async task on every activity destroy and reinitializing it once the activity/fragment is recreated. It seemed like the most decent solution given the constraints.
To destroy the async task, we simply called Cancel on the task.
task.cancel(true)
We do not have to worry about interrupted downloads as the check to pause the task, lies in the next iteration of the worker loop we are in:
protected Boolean doInBackground(String... urls) {
Boolean isDownloadSuccessful= false;
for(String url:urls){
if(isCancelled()){
break;
}
dostuff();
}
Thats all folks, from part2 of this blog series. Part 3 will talk about small tidbits I emplyed to make the listview more pretty, fast and flexible.
Signing off, good night!
Lucidly yours, Listview!
Recently we implemented a feature for our app that involved developing a rich list view, full of high-res images and text. After playing around in the world of list views for a week and a half, I can surely say that it’s not child’s play! As a developer, a lot of things need to be kept in mind while implementing lists that scroll efficiently, look great and work seamlessly. Through this and some subsequent posts, I wish to share some of the challenges I faced, and how we went around solving them:
PART 1: Using AsyncTask for Background fetching of Images
The feature involved displaying high-res images, each almost a quarter of a MB, on the list view. Downloading big images can be a bigger task, especially if the user is active on mobile data and is subject to varying signal strengths. It is hence absolutely essential to use a background task to download the images. This prevents the UI thread from being blocked till the download completes.
Initial approach :
The initial approach we took was the spawn a separate async task for every background image. The download method returned a boolean yes/no for the download success and accordingly we used to update the list view. But eventually we realized that this might be an overhead for us, since the API usually returned a high number of items for display.
So, finally we went on with a single async task and passed it the list of urls from where the images had to be downloaded.
If you have already worked with listviews, you will be knowing that in android listviews use adapters to render themselves, which in turn feed in data from a data source. We initialize the d This data source is passed to the adapter while setting data for that row. For example in our listview, we have:
@Override
public View getView(int i, View convertView, ViewGroup viewGroup) {
ViewHolderItem viewHolder;
if(convertView == null){
LayoutInflater inflater = context.getLayoutInflater();
convertView= inflater.inflate(R.layout.list_item, null, true);
viewHolder = new ViewHolderItem();
initializeViewHolder(convertView, viewHolder);
convertView.setTag(viewHolder);
}
else {
viewHolder = (ViewHolderItem) convertView.getTag();
}
// Get data at position i
Data data = dataArray.get(i);
setDataForRowView(viewHolder, data);
return convertView;
}
The getView() method of our listview is responsible for rerendering the listview. When we call onnotifydatasetchanged(), it refreshes the listview from the data source,
private void refreshTheListView() {
if(getView() != null && listAdapter != null){
listAdapter.notifyDataSetChanged();
}
}
The download task, downloads and saves images to the directory mentioned as an argument. The structure of our task looked as follows:
public class DownloadRemoteImageAsset extends AsyncTask<String, Void, Boolean> {
private final String subDir;
private Activity activity;
private Callback downloadCompleteCallback;
public DownloadRemoteImageAsset(Activity activity, String subDir, Callback downloadCompleteCallback) {
this.activity = activity;
this.downloadCompleteCallback = downloadCompleteCallback;
this.subDir = subDir;
}
@Override
protected Boolean doInBackground(String... urls) {
Boolean isDownloadSuccessful= false;
for(String url:urls){
if(isCancelled()) break;
Boolean wasFileDownloaded = Utils.downloadAndSaveLocalImageResource(activity.getCacheDir() ,url, getImageName(url), subDir);
if(wasFileDownloaded){
//Will be false only if ALL image downloads fail, in all other cases we need to call onsucess.
isDownloadSuccessful = true;
}
}
return isDownloadSuccessful;
}
public String getImageName(String url) {
String baseName = Utils.getBaseName(url);
String extension = Utils.getExtension(url);
return (baseName +"."+ extension).toLowerCase();
}
protected void onPostExecute(final Boolean isSuccess) {
if (isSuccess)
downloadCompleteCallback.onSuccess(null);
else
downloadCompleteCallback.onFailure(null);
}
The boolean variable isDownloadSuccessful keeps track of the download. In case we have even 1 out of n images downloaded, we need to call the success callback that refreshes the listview on the UI thread. The callback was passed on while initializing the task.
private void downloadImages(){
downloadRemoteAsset = new DownloadRemoteImageAssetTask(getActivity() , imageDirectory(), new Callback() {
@Override
public void onSuccess(List<BaseResponse> response) {
refreshTheListView();
}
@Override
public void onFailure(ErrorResponse response) {
}
}
This approach works as a charm. Will be covering more details about async tasks and things to take care of, in the next post! Till then, stay tuned :)
Baby steps to Deep Link your android apps!
We recently had to implement deep link functionality for our project. The concept was new to me till the word itself, and I gathered a couple of findings as I read up about the same. I would like to share the same in today’s blog post.
Deep Linking is a concept wherein I can open any activity of an android app from a custom URL in our app. Since I can access the functionality of an internal section of an app, it is termed as a “deep-link”. The way android achieves this is using “Intent Filters”. Intent Filters are a way in which we can tell an activity to listen to certain kind of intents. Lets go a bit more detail into what makes up an intent filter.
Intent filters are in an apps manifest file. They are opened up using implicit intents using a general action to perform.
Actions can be of various types: a simple view action/ share (send) action/edit/dial etc.
Category gives me more info about how the intent can be launched for ex. Browsable category implies I can start that intent from a browser etc.
Data - usually describes the type of data to be processed, and the format of the data.
For example, according to the android documentation, the attributes of the Data URI can be specified as <scheme>://<host>:<port>/<path> .
The scheme is the protocol used for example in http://www.google.com, http is the scheme. There are multiple ways in which you can define your path, “pathprefix” allows you to match initial part of the url, while “path pattern” allows you to match a complete path as a regex.
Our requirement was to deeplink http/https links received as part of emails to custom activities in our app. We had a restriction to not the change the format of the link, neither was embedding a native app specific url in the email an option. These requirements implied that since url was mostly http, we would always have multiple apps apart from our own app, like Chrome or Firefox that could also intercept such intents. Hence, we would always get an app chooser. However, the business did not want a chooser popup. They wanted the “browser” to redirect the user to the app in case it is installed on the user’s device.
The approach that can be used to solve this is that we let the html page being loaded handle it and let it try and redirect the user to the native app url on page load. So basically, include some JavaScript in the head element of your HTML page that tries to opens your deeplink URL on page load of the document. If the user has the app installed, then the browser would recognizes the URL scheme for your app and launch the deep-linked activity of the app.If the app has not been installed, the browser simply will not recognize the URL scheme and the alternative page would load as usual.
Another thing to take care of is that, to make the above possible, we need to add category “Browsable” to our intent filter, which can allow activities to be launched from the browser itself. This can be given as such:
category = android.intent.category.BROWSABLE.
Last but not the least you can use the Query Parameters, if any passed in the URI for deep linking by calling queryParameters.get(key) and use them in the activity.
Thats all for today. Hope this helps you!
Memoirs from the Grace Hopper Conference, 2014 :)
Ever since my university days I have observed that be it college, open source communities or the workplace, the ratio of men to women is significantly skewed. There are a couple of factors that contribute to this. Apart from lack of awareness about the opportunities available and how to make best use of them, cultural fabrics and mindsets also play an important role. All these and much more were the centre of discussion at the Grace Hopper Celebration of Women in computing conference held in Phoenix, Arizyyona from 4th to 10 October this year. As a speaker and an attendee, I consider myself fortunate to be able to see perspectives from a much closer level and do my bit to improve the situation.
The Conference started off on the sunny morning of the 8th October 2014. It saw a variety of talks ranging from technical topics like Molecular Biophysics, Data Science, DevOps, Networks to more generic skill-building ones like Parenting in the tech world, Interview Strategies, how to make your resume stand out and many that delved into the everyday lives of a developer , quality analyst, business analyst etc.
As a mentor in the student opportunity lab, I met many enthusiastic young women. Being a follower of the Free Software Movement and the Open Source world, I wanted to share my learning with the larger community out there. The format of my talk was different from the usual style presentation, with an intimate audience of ten people at a time. We did multiple such sessions , each spanning about 20 minutes or so.
Initial butterflies were soon taken over by healthy discussions at my table as i told attendees about the concept of FOSS , its importance, community structure and how it was relevant for them to know about it and contribute as a student. Having so many energetic women around with a zeal to make a change and listening to their stories definitely filled me up with a lot of positive energy!
Among the multiple sessions that happened on that day, I got a plethora of questions .. Ranging from "what exactly is open source ?", "Oh! I thought its something on github!" to "Do we need to pay for getting an open source licence?". Answering these and clearing many similar mind blocks regarding the specifics of open source world was a very rewarding experience.
The rest of the conference was mostly spent at the ThoughtWorks booth. We talked to a huge number of people , telling them about ThoughtWorks, what we do and what are our practices. Our "I am the next grace hopper" frame was the centre of attraction, and the polaroid was always busy. We also managed to get in a whopping number of people into our review and interview system. Yippee :)
Will be attaching a few memories of the lovely time spent with my ThoughtWorker buddies soon! :)
#Birthdays Are Fun ..got a new Pebble SmartWatch! :)
My birthday this time around was different and exciting in many ways. It was my first birthday out of station, since I was in Pune, India for my project assignment.
One of the things that made my day really special was my brand new Pebble SmartWatch, gifted to me by one of my very close friends! For those new to Pebble, it is a smart-watch for Android and IPhone, which throws the stress of pulling your phone out of your pocket all the time, straight out of the window! You can configure everything from WhatsApp, email, SMS to reminders on it. With thousands of exciting and g33ky watch faces available, Pebble also provides me a neat API if I want to build my own Pebble SmartApp :)
I have a Mario grinning back at me whenever I glance at my pebble now.
I think its time to get out my Notebook and jot down some ideas for this!
#GeekyFun #SuperExcited #MyFirstSmartwatch ;)

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming