This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| from pathlib import Path | |
| path_to_video = Path("some/path/to/video.mp4") | |
| video_handler = cv2.VideoCapture(str(path_to_video)) | |
| n_frames = int(video_handler.get(cv2.CAP_PROP_FRAME_COUNT)) | |
| w = int(video_handler.get(cv2.CAP_PROP_FRAME_WIDTH)) | |
| h = int(video_handler.get(cv2.CAP_PROP_FRAME_HEIGHT)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| inline float fast_exp(float x) | |
| { | |
| union { | |
| uint32_t i; | |
| float f; | |
| } v{}; | |
| v.i = (1 << 23) * (1.4426950409 * x + 126.93490512f); | |
| return v.f; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| import os | |
| import numpy as np | |
| from pathlib import Path | |
| from math import floor | |
| from typing import * | |
| EXTENSIONS = {'.png', '.jpeg', '.jpg'} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This code has been taken from https://github.com/immersive-limit/coco-manager/ | |
| # Usage: python filter.py --input_json /path/to/instances_train2017.json | |
| # --output_json path_to/saved.json --categories person dog cat | |
| import json | |
| from pathlib import Path | |
| class CocoFilter(): | |
| """ Filters the COCO dataset | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. Go to https://developers.google.com/docs/api/quickstart/python and download credentials.json by clicking on "DOWNLOAD CLIENT CONFIGURATION" | |
| 2. Put credentials.json in your working directory | |
| 3. Do `pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib` | |
| 4. See the code above. | |
| Useful link on editing, inserting and deleting text: https://developers.google.com/docs/api/how-tos/move-text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git commands and tricks in comments | | |
| v |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://www.youtube.com/watch?v=ANsVodOu1Tg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| comments |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -qscale 0 /tmp/out.mpg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| See comments below |
NewerOlder