Easy and fast path to Video Object Detection (counting sharks)

Video Object Detection is a very interesting problem that could help a lot of people. I found out about it talking to a shark researcher (maybe not his exact title). They have grad students counting sharks in a video from an underwater camera. These videos can be very long and sometimes there are no sharks in hours. I thought about Machine Learning instantly, what could go wrong. I started reading about it and found different approaches.

  • Auto ML Solution (Google, MSFT…): I used these solutions in the past with images, with good results. The con is that these services do not provide video support, at least I was not able to find it.
  • Tensorflow:  I watched a ton of videos of examples of the Object Detection API. Be careful with the videos, search for recent ones the version changes can make very hard to follow the tutorial. I had some trouble trying to train the model with my own images. It might have been a combination of the documentation, my package management and maybe luck. I ended looking for another way.
  • Tensorflow Object Counting API: I found this repository. It has great examples and it’s built on top of Tensorflow. I still had some problems training my own images. My only comment would be that this API still lacks the abstraction I wanted to see on an API, at least for the training part.
  • Detecto: I found about this repository and the first thing I noticed was that it promised the abstraction I was looking for. I managed to train with my own images, all the different examples are ~5 lines of code. You don’t need to understand about Pytorch in order to use it. I was able to run it on a Google Collab, the free GPU’s made the training process faster. At some point going to the Tensorflow could make sense, but to start I recommend Detecto.

I need to feed more images to the model but here are is an example of the results:



30 things I learned at my first job (Daniel Rojas)


Your diverse background can be your main advantage. Supercharge it this quarantine.

I’ve seen in twitter a lot of people learning and coding on this quarantine, which is great. Learning and doing hard stuff can keep your mind healthy and you won’t get bored. There is something I think we should not miss while spending time at home learning.

Imagine that in the whole industry everybody came from the same background. Everybody majored in Computer Science, watched the same movies, had the same interests and liked to work in the same problems. We were not very far from this some years ago. Now we are in a very different place as an industry, we have a lot of folks coming from different places (education, work experiences, interests, culture..). Which is what need to solve the most challenging problems. We are good, but we can be better.

I’ve seen a lot of people studying frontend, backend, ML, Blockchain and similar things. Which is good and you need to do it, although don’t forget the other stuff. By that I mean, the stuff that makes you unique. As I mentioned at some point, hiring decisions can be very tight and sometimes you want to hire 2 people but just can’t. It’s the small stuff that makes the difference (happens very similar when thinking about promotions and raises). The good news is that small stuff it’s hard to copy because it has to do with you.

Here you’ll find a list about “other stuff” and how you can supercharge it this quarantine:

  • Your past work experience: This is a great tool from people transitioning into tech. These experiences can be a great advantage if they align with the role you are applying to. For example, you were a tour guide before jumping into Computer Science and you are applying now for a Software Developer role in Tripadvisor. And in order yo supercharge it, learn more about the industries you’ve worked, take a small MOOC, read some news about it or read a book on that field. We tend to underestimate our knowledge about a certain industry, trust me after a couple of years working on a specific industry you’ll have a ton of knowledge, use it!


  • Your interests: Humans tend to be curious about a group of fields and these can be uncorrelated. You might want to learn about anthropology, astronomy, medicine, sports, food or almost anything. Take a small break from coding and learn about a field you are interested in. This will have two effects: you might find relationships between the field and coding, and this could help you in a future interview. Either by the industry, you are applying or to build rapport with the interviewer. Just taking a break from coding can bring great results.


  • An action related to coding: You’ve been coding for the past 2 days non-stop that’s good. But also have in mind other related tasks that are not just coding. Try writing a Blogspot, create a video-tutorial or write a small book. These are great superpowers that can make you a better developer.

The main goal of this quarantine is to stay safe. It’s great that a lot of people are learning new stuff and hopefully a lot will be able to land new gigs soon. Keep coding (and doing other stuff)!


30 things I learned at my first job (Daniel Rojas)


4 non-tech interview questions that can make you stand out and land the job

The interview process is an art, probably a broken one. I know it has a lot of different factors and some maybe even random. But let’s focus on what we can control. We can control what you prepare and how well you perform. For the technical side (algorithms, inverting a binary tree…) there are a ton of good resources you can look for. 4 questions tend to be overlooked. These questions are not enough to turn around a bad technical interview, but you can check all the boxes if you ace them (a lot of these processes finish with very tight decisions).

  1. What have you heard about this company? This is a great opportunity for you to show how much you have prepared and how bad you want this job. You don’t want to show like this is just another interview in your whole process. Or worse that this is practice for the interviews you really care about. Here are some ways you can prepare:
    • Start by understanding the sector. You need to have which sector are they and how do they make money. Google can help you or talk to a friend who knows about the company/sector. Understand what the sector is going through, are they growing, shrinking. Which are the biggest competitors/menaces?
    • Understand the company from 10,000 ft. Are they public or private? How much revenue did they make last year? Any interesting acquisitions lately? Something important on the news? If the company is public, try searching for the last earning call transcript. This will help a lot and you’ll find opportunities to use your preparation.
    • Understand the company on a local scale. How is this branch doing? When did they open? Are they the new kids on the block? What is their relationship with the mothership?
  2. Tell me about the hardest problem you have solved. This could be considered a technical question but I want you to focus on the storytelling. Set a good context about that last problem that you could not stop thinking about. Be very specific on the problem, the avenues you tried and how did you end up solving it. You need to project grit and that you never give up. Also, explain how would you approach a similar problem now that you have solved that one. Extra credit if the problem is related to the technologies they are working with.
  3. Tell me something interesting you read lately. The interviewer is trying to find out if you really like what you do. Do you read about stuff in your free time, how do you keep up with all the stuff that is changing. I don’t recommend that you read a super complex article so you can show off. Just try to remember what you have read lately, explain why it was interesting and what you learned. This does not need to be 100% related to the technologies they work on, it could be about another field that is interesting for you (cybersecurity, networking, anything related to tech).
  4. Do you have any questions for me? A lot of people miss this opportunity to show they have prepared and to gain valuable information that could help in the following processes. Ask genuine questions about their job, work-life on that company, how are they’ve been affected by global events (COVID19 for example) and anything that you might want to know. Try to come prepared with some questions but have your eyes open for any question that might come up during the conversation.

An interview should be a conversation. It could happen that these questions are not included. Although you can use different parts of the interview to show what you have prepared. The easier part is at the end when they let you ask questions. Use that free form time to show how you have prepared and why you are the right person for the job.


30 things I learned at my first job (Daniel Rojas)


Which programming language should you learn on this quarantine?

I recently had a conversation with a group of college students about if they should learn R or Python. This might be a ML/AI kind of question although the possible answers apply to different areas of Computer Science. How do you choose between studying React or Angular? Rails or Laravel?

The first idea is that programming languages are like instruments. We use instruments to play music, but you can interpret the same song with different instruments. It’s really hard to choose between programming languages, every language has its pros and cons. If you understand well the fundamental principles (music) it does not matter which instrument you choose.

The second idea is borrowed. Inspired from a great tweet from Edouard Harris. If you are starting to code learn a language that interests you or that is related to one of your interests (build videogames for example). Once you are getting more familiar you can learn a language with bigger business applications.

The third idea would be what is your purpose for learning a language during the quarantine. Do you just want to have fun? Do you want to land a new gig? Pure intellectual curiosity? Answering this question might be a big percentage of the answer you are looking for.

It does not matter what you learn this quarantine, stay safe and happy coding.


30 things I learned at my first job (Daniel Rojas)


What every engineer should know about business cases

A lot of people think engineering and business should not be in the same sentence. I think they should be together more often. A lot of the problems I’ve seen in companies is engineers and business not talking to each other. That miscommunication can bring a lot of trouble to an organization. From a more positive side if you are starting as an engineer, understanding the business and communicating in their language can be a great superpower.

The purpose of this text is not to go through the different reasons the disconnection happens, but to propose a bridge. I am not going to suggest we send our all business friends to CS school (although it could help also) but the bridge in this scenario is the other way around.

Think about any interaction you have with somebody from the business side (Product Owner or something like that). A lot of times the conversation is engineers think they should build X but the business does not understand why. This causes two fundamental problems: engineers can’t build the right stuff, so everything crumbles (hello technical debt!) and business does not understand why engineers want to build X (looks like they just want to scratch their own itch).

Next time you are planning this kind of conversation. Frame it in a business case. This is a very simple exercise, where the central idea is to have a return of investment. We are going to build X, it is going to cost the company Y and we are going to make Z money, so in T time we are going to recover the money, after that we’ll profit. There are far more complex and complete approaches than this, but think it in a simple way. If you buy a car and use it for Uber, how long will you recover the money you invested in the car.

I know it’s pretty simple, but I want you to apply it to engineering. There is two kinds of costs: development (your time and your team) and infrastructure (you are probably working on cloud, so you’ll need a place to host all those shiny microservices of python scripts). Getting the cost should not be hard and if it starts to get very complex a good approximation will work.

The other part of the equation (how much money is the company going to make or Z in our equation) can be a little be more complex but still doable. There are several ways the company you work for can make money with software:

  • Selling more: You’ll be able to handle more traffic, products, regions or regions just to name a few
  • Being more efficient: I’ll take less time to close a deal, so if you are faster you’ll close more deals. Or you reduce costs, now everything is more automated and you don’t need a lot of humans ( I am not saying you should suggest replacing other coworkers with bash scripts, not cool, hopefully, they’ll be able to perform more meaningful tasks than what they were doing before)
  • Reducing risks: If we use MQRabbit there will be a lower chance of everything crumbling on Black Friday. So you won’t wake me up in the middle of the night saying that the site is down and people can’t buy cat food

I am sure there are a lot more ways, these were meant to give you examples and light up your inspiration. A cool trick is to involve the business people if you explain a little your idea they can think of other way of framing it.

Once you have costs and ways to make money, its just a matter of thinking how long it’ll take to recover they money you invested.

This is not a silver bullet not all your projects will be approved by this method. Although it will start some very interesting conversations that might help you build what you think is worth building.

Happy to hear from you on twitter.


A simple test to know when you need to follow another leader

First things first, I hope you never need this test. I hope you have a long and happy career and you always love working with your boss. Although by simple probability, this might not happen. There is a big chance that you end up working with somebody you don’t like or worse, you might complete opposites and have a different set of values.

Given that this happens at some point in your career, it brings a very interesting crossroads. This might not be only negative, it could be a chance to work on your versatility, communications skills or just your ability to push through difficult times. But there is a point where it would just be too much. A bad leader can damage your life, your career and you can end up not liking a job that you loved in the past.

How to know when you are learning and when you should look for a different direction (new job, new team, new life)? I found this simple test quite useful. Imagine you and your boss have a lot of success, you destroy all the company goals, you have a great year and you make a dent in the universe. After you imagined that, ask yourself the following question: Do you want to be with him in that position?

I told you the test was simple, interpreting the results might be more complicated. This simple question can help you think how different are you from your boss, if huge success still sounds like a bad idea, you might want to revisit the idea of asking to work with someone else. This could also help you understand if you and your boss are just going through a rough patch.


How the new deep learning framework revolution will look like

In twitter I came across a very interesting tweet from Andrew Trask.

Screen Shot 2020-03-26 at 6.53.19 AM.png

At first I was very confused on what he meant by data. I thought it had something to do with ETLS or ways to gather more data quickly. Maybe something related to data quality or an algorithm that searches for relevant data inside your organization. I asked him if he had a blogpost and he provided a whole site. It’s a whole open-source organization working on this problem.

The next generation on deep learning frameworks will be privacy. Not so much on obscuring your data but how to work with private data (Imagine the worst, healthcare data, paychecks, anything more private than that). It turns out that if you spend time thinking about this is a big deal.

A lot of people say data is the new oil. Which is something I think is not the future, it already is. In order to power our very cool algorithms, you need data and sometimes a lot. But due to some new regulations (which is a whole other discussion if they should exist, I think they do), a lot of data is off-limits. It’s like having oil in a country you can’t access. Andrew’s organization is building a lot of tools that help us go to that country and use the oil. They have a very cool group of techniques to handle these problems. And they are working on more to come.  On the other hand some countries claim the advantage of working with private data due to their lack of regulations, OpenMined is leveling the playing field.

If you are interested in this topic I suggest you take the tutorials or join the slack, and if you liked this blogpost feel free to find me on twitter.



Trust in enterprise AI starts way back

Being the first one to implement a Machine Learning algorithm for the first time in a company comes with good questions. Nontechnical folks will need to begin by understanding ML and the art of the possible. Although a great number of questions will come just before the go-live. They’ll need to test and be sure that the algorithm works and will perform as expected.

That’s the point where this kind of technology and tech start to intersect. People will be afraid of something they don’t understand and also about something that is non-deterministic (little changes in inputs can change the outputs). There are different ways of building trust in these algorithms, some are sexier than others (spoiler alert, you might want to start with the unsexy ones).

The first way to build trust is simple: test a lot. I mean a lot. Throw a lot of data to test and check the results. These will grow confidence in the nontechnical folks. The caveat is that this could take a lot of time, manual spot-checking and you might not have enough data available.

Other way is explainability. There is a whole AI field working on methods to explain the algorithms and be able to tell what went wrong when it outputs a wrong prediction. This is something worth checking out, but you might need to combine it with the first one.

The third and last way is data governance and data integration. A lot of companies have multiple sources of data (with duplicated data), nonexistent quality controls and zero governance. This means that data is not available, is hard to find and nobody is responsible for the data. If you are not able to trust the data you are feeding to the model, you will not be able to trust the results. Even for testing purposes, you need ground truth data, if it’s not grounded everything might be more difficult.

A lot of companies might want to run before they can crawl and that’s ok. I think ML projects are a great excuse to start doing some work on data governance and data integration. Just try not to forget about these two things. If you set the right foundation the future projects will come smoother.



What Reinforcement Learning needs to be applied in business

One of the most promising areas in AI is Reinforcement Learning. We’ve seen it beat top humans in Go, League of Legends and Starcraft. We’ve also seen it learn to play hide and seek. This kind of feats was impossible to achieve using former learning styles (supervised or unsupervised). Although we have not seen a lot of business applications for Reinforcement Learning, we’ve seen very interesting robots and some recommendation engines but I think there is a lot of space to explore this intersection.

A lot of research is being done on the agent side of Reinforcement Learning. We’ve seen techniques that allow agents to solve problems faster. We are getting better at beating humans in Go but that won’t necessarily help us apply this kind of technique in the business world.

In order to apply Reinforcement Learning in the business world, we need an environment builder. From my perspective, we have great agents and there is a lot of momentum on that front. We are lacking a way someone can build an environment that represents a business problem. The holy grail would be that a business user can build that environment by himself (with drag and drop), we can start with baby steps even a little framework with python scripts could work.

Once we have a way to build these environments, I think we’ll see a lot of different applications. We could see new stuff on forecasting, navigating complex sites and invoicing to name a few.

If this is something you are working on or seems interesting to you I would love to hear about it on twitter.


Always show up

In your first job, you’re goint to have a big screw-up. Or at least you’re going to think so.  It doesn’t matter if you’re really good or really carefull, it is going to happen. For me, it was a big failing project.
The project started as all the failing projects start: running. Speed was the key, we had a big deadline and there was no space to fail (you can always fail, the world is going to keep working). I worked hard, as hard as I could. I did all I could at that time. Now I see things different, but at that moment, I did everything I believed it could help us finish the project on time.

And then came the day. The final day to deliver the complete project. The afternoon before I knew we were not going to be able to complete it. I had an awful night. I didn’t talk to anyone, I just thouhgt and thought. I couldn’t sleep. I was ready to quit, I wanted to stay at home. I just didn’t wanted to go to the office.

But I had to. And I did. I went. I tried to come up with solutions for the project. I could not find anything. Everything I thought was impossible. I was really sad and a angry. I wanted the project to be successfull. But sometimes things don’t work as you want.

So I just showed up. I went to office and faced my problems. I had no particular strategy, just say what had happened. I had some alternative plans, but none for the same day.  I started imagining all the things that could happen. I thought I was getting fired, downsized, the company I worked was getting sued or something like that.

Then, the moment arrived. I said it, the project wasn’t ready. It was impossible to have it ready for the same day. What was funny, the project manager (he was some scary guy from another company) just said Ok. I said: Ok what? He just told me: Finish what you have to finish and then tell me.

I was relieved. I was happy. Then I felt a little stupid. I had a really bad night, a lot of negative thoughts for nothing. It ended really well, it could have been worse. I had no control it.