endeavour10020 / aicity-2021-track4 Goto Github PK
View Code? Open in Web Editor NEWThis is the repository of NVIDIA Aicity Challenge Track4.
This is the repository of NVIDIA Aicity Challenge Track4.
I have tested several anomaly detection repositories source code, and most of them didn't work. I have some advice for the upcoming code
Test it on a single purpose container like Docker (or you can just use Google Colab if you want). A base image like Ubuntu 18 is a good start to track if there are dependencies that must be specified in a requirements.txt file.
Prefer to use pathlib over os module or raw string for paths.
Use absolute paths over relative paths to allow the scripts to run wherever the user is executing them.
Use argparse to input paths (e.g. paths of directory). The following is a good example
import argparse
import pathlib
def parse_cli() -> argparse.ArgumentParser:
current_directory = pathlib.Path(__file__).resolve().parent
parser = argparse.ArgumentParser(description="Extract frames from directory containing videos.")
parser.add_argument("--root", type=pathlib.Path, help="directory containing videos to be processed",
default=current_directory / "sample_video")
parser.add_argument("--ext", type=str, help="extensions of the videos within the directory to be processed",
default="mp4")
return parser
for i in range(1, 101)
to iterate video files. If a video doesn't have a name like 1.mp4, this won't work. Iterate them like pathlib objects and convert it to str when using OpenCV.import time
def main(args: argparse.Namespace) -> int:
start_time = time.perf_counter()
# Some code
end_time = time.perf_counter()
res = time.strftime("%Hh:%Mm:%Ss", time.gmtime(end_time - start_time))
print(f"Finished in {res}")
return 0
if __name__ == "__main__":
main(parse_cli().parse_args())
The reason of encapsulating the running code within the main function, you can find it in main โ Top-level code environment
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.