[Devember 2021] Learning python and machine learning while creating image organizer and dataset builder

Disclaimer

I have no idea of what am I doing, I knew web and desktop programming then dived headfirst into this stuff blindly and I got excited.

The Project

In general I’m trying to learn python and some machine learning stuff, currently there’s two repositories but more will spawn later if needed.

Tensorflow Assisted Image Organizer

Detects faces inside of an image, compares the face with the model, and moves the file to a sorted directory based on the character name. Currently works on anime characters but I believe it can be broadened to many things.

Current Models

  • Hololive | All gen except the newest (not enough image) | 33
    • Low accuracy 20-30% correct from 20 test image
  • Love Live | 1st, 2nd, and 3rd gen | 30
  • μ’s | All main character | 9
    • Accurate but tends to weight in to a single character
  • Nijigasaki | All main character | 10

I’ve been working on this repository for 1-2 weeks and turns out it not that easy. Creating a universal template to a model is the idea so the code won’t get bloated, and I have several problems creating the model since you need a lot of images it, because of that I made this thing.

Trawler

This one creates the dataset for the model from a video/website and build a model for the previous program. It extracts the faces in video frame/image and create a small model to automate the sorting process, you’ll still need to sort it manually for the first time but I tried to automate it with color averaging (cave.py?) CBIR or something I just discovered it few days ago.

Flow

Conclusion

So yeah just like my post, my development progress will be erratic based on what I found while surfing the internet and whatever ideas came out of my head.

I will post update on the progress if it’s big enough, small changes will mostly be commits to the repository.

1 Like

Dev Log - 1

I tried to unify all scripts within trawler, didn't go so well but it works for now. passing variables from function to function is one hell of a work when your code is such a mess.

Trawler

Now this program can be run without any existing model, the only thing the user need to provide is character names, before extracting Images from the videos it will download thumbnails from booru sites(full image is not permitted since they're big), because the download is already sorted model creation can be initialized without user interference.

I don’t have the footage when the program was running since trial and error method was used so here’s the result.


loss: 0.6353 - categorical_accuracy: 0.7344 - val_loss: 0.5383 - val_categorical_accuracy: 0.8203

I guess it’s not that bad since only 8 epoch was ran with with 8 steps and validation, it can be improve by increasing the steps but it will take ages to finish (at least on my computer).

The next step will be making the code less of an eyesore to ease further development.

Dev Log - 2

Got sidetracked for a bit, made a program to track crypto price (currently XRP).

Dayalert

For every hour this program will get the data from some crypto coin (price, volume,etc) and saves it into json files named by the date and hour. Commands can be written to get the summary, start the logging, and alert setting in the future.

Hopefully this program will finish soon so I can continue on taio and trawler. And currently it’s private because the program includes API keys, it will be made public eventually.

Dev Log - 3

Been quite busy lately and I'm still working on the crypto tracking stuff

Dayalert renamed to Panopticoin

Learned quite a lot of stuff from this project: flask for the graph and api server, sqlite database to store the data instead of json files, and some algorithm stuff.

def get_pattern(coin):
  print_data = sql.select_data_by_symbol(coin)
  #only use the last column
  print_data = [item[4] for item in print_data]
  pattern_list = []
  pattern_result = []
  counter = 0

  for i in range(1, len(print_data)):
    if i == len(print_data)-1:
      continue
    counter += 1
    if plus_or_minus(print_data[i+1]) != plus_or_minus(print_data[i]):
      pattern_list.append(counter)
      pattern_result.append(plus_or_minus(print_data[i]))
      counter = 0
  
  return pattern_list, pattern_result 

This function for example, it returns the average of how many updates does it take for a coin to go up or down,

47

I have no idea what the numbers mean but the coin tends to go along with the biggest value and the higher the difference the more easy it is to predict the future pattern.

I tried to implement time series forecasting stuff on this but so far nothing is working, more research is needed.

Trawler and TAIO

Trawler is basically complete the update it needs is to make the code tidier and collect data from different website/places. and for TAIO I’m gonna use the lite version in Trawler to reformat the code.

1 Like