All Projects → mdiller → Twitchclipmatchfinder

mdiller / Twitchclipmatchfinder

Finds a dota match when given a twitch clip

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Twitchclipmatchfinder

Dota2WebApi
A Dota 2 Web API for Liquipedia
Stars: ✭ 24 (-84%)
Mutual labels:  dota2
Vac
Source code of Valve Anti-Cheat obtained from disassembly of compiled modules
Stars: ✭ 254 (+69.33%)
Mutual labels:  dota2
Steamworks
Exposing SteamWorks functions to SourcePawn.
Stars: ✭ 70 (-53.33%)
Mutual labels:  dota2
butterfly
Butterfly Dota Replay parser
Stars: ✭ 20 (-86.67%)
Mutual labels:  dota2
bota
🤖 A discord bot for Dota2 community
Stars: ✭ 21 (-86%)
Mutual labels:  dota2
Gametracking Dota2
📥 Game Tracker: Dota 2
Stars: ✭ 375 (+150%)
Mutual labels:  dota2
dotacard
You are at FODA artwork repository. Play now for free
Stars: ✭ 22 (-85.33%)
Mutual labels:  dota2
Aurora
Unified lighting effects across multiple brands and various games.
Stars: ✭ 1,673 (+1015.33%)
Mutual labels:  dota2
Gravebot
An awesome bot for Discord
Stars: ✭ 258 (+72%)
Mutual labels:  dota2
Dota2scripts
Lua scripts for DotA2.
Stars: ✭ 62 (-58.67%)
Mutual labels:  dota2
dotapatch
Dota 2: Changelog formatted as it should be.
Stars: ✭ 11 (-92.67%)
Mutual labels:  dota2
Dota-2-Chat-Wheel-Soundboard
A Soundboard that plays Chat Wheel Sounds (from The International 7 Compendium) over ingame voice.
Stars: ✭ 14 (-90.67%)
Mutual labels:  dota2
Dota Webassets
Dota images and spritesheets
Stars: ✭ 25 (-83.33%)
Mutual labels:  dota2
go-opendota
Go client library for accessing the OpenDota API
Stars: ✭ 34 (-77.33%)
Mutual labels:  dota2
Foda
You are at FODA source code. Play now for free
Stars: ✭ 92 (-38.67%)
Mutual labels:  dota2
game apis
This repository is for integrating with different apis to allow you to pull player or game data
Stars: ✭ 24 (-84%)
Mutual labels:  dota2
Dota2 Predictor
Tool that predicts the outcome of a Dota 2 game using Machine Learning
Stars: ✭ 332 (+121.33%)
Mutual labels:  dota2
Dota2
🐸 Python package for interacting with Dota 2 Game Coordinator
Stars: ✭ 129 (-14%)
Mutual labels:  dota2
Dotabuddy
DotaBuddy is a cross-platform, open-source application with helpful features for when you're playing a match of Dota 2.
Stars: ✭ 93 (-38%)
Mutual labels:  dota2
Node Dota2 Api
Dota2 web api node.js version
Stars: ✭ 36 (-76%)
Mutual labels:  dota2

TwitchClipMatchFinder

This tool takes a twitch clip of someone playing dota and finds the match (match id) of dota that they were playing so you can get a dotabuff/opendota link or retrieve stats for it. I've created a reddit bot that automatically finds clips posted and gets matches for them: /u/DotaClipMatchFinder (The name is slightly different because TwitchClipMatchFinder was too many characters)

How it works

  • Get some info about the clip via the twitch api
  • Download the mp4 of the clip
  • Extract the first frame of the mp4 (using OpenCV)
  • Find the heroes in the top bar of the image
    • First, crop the image to only look at the top row where the heroes should be
    • Load all the hero images (plus arcana images)
    • Check if the hero is in the given image and if so, where (using OpenCV)
    • Filter out heroes that are in the wrong place in the image
    • Sort the results to get the 10 heroes that are most likely in this image in the right order
    • Do a bunch of other things to make sure we got the right heroes in the right places, because computers are bad at pattern detection
  • Use this opendota api endpoint to search for matches containing exactly this hero matchup
  • Pick the correct match out of the results based on which one has a start time closest to the time that the clip was taken

Libraries used

Usage

This library was built with the idea of using it as a reddit bot, which is its main use, but it can also be used separately to find specific clips. The find_match function in finder.py can be called to find the match for a given clip slug (the 'slug' is the bit at the end of the twitch clip url that is a bunch of words together.) The finder.py file can also be started directly if you give the clip slug as the argument. Here is an example for https://clips.twitch.tv/ExuberantBillowingHumanMau5:

> python finder.py ExuberantBillowingHumanMau5
finding for ExuberantBillowingHumanMau5
matched for the following heroes:
              Huskar:    (16, 8) {0   1.56} [0.9541687965393066]
         Lifestealer:    (79, 8) {1   1.56} [0.9161773920059204]
              Mirana:   (142, 8) {2   1.56} [0.9785874485969543]
             Abaddon:   (205, 8) {3   1.56} [0.9478229880332947]
                 Axe:   (268, 8) {4   1.56} [0.8044984340667725]
          Omniknight:   (539, 8) {5   0.77} [0.9744465351104736]
         Earthshaker:   (602, 8) {6   1.11} [0.929298460483551]
       Faceless Void:   (665, 8) {7   1.11} [0.9520202279090881]
           Pangolier:   (728, 8) {8   0.44} [0.9074560403823853]
             Phoenix:   (791, 8) {9   0.77} [0.966294527053833]
found match 4997200445
started 12 minutes before the clip was taken.
https://www.opendota.com/matches/4997200445
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].