Initial commit

This commit is contained in:
Senad Uka
2020-05-31 22:38:19 +02:00
commit 858fafc3c5
1280 changed files with 65918 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
class VideoAnalysis
mattr_accessor :use_overlay_video, default: true
def initialize(video, reanalysis)
@video = video
@reanalysis = reanalysis
end
# Use the custom hash to generate JSON format
def as_json(*)
to_hash
end
def to_hash
{
bucket_name: aws_bucket_name,
collection_id: video.project.headshot_collection_uid,
video_object_name: video.file.key,
reanalysis: reanalysis,
}
end
def overlay_video_url
return if !use_overlay_video
return if response.overlay_video_url == "None"
response.overlay_video_url
end
def first_appearances
response.first_appearances
end
private
attr_reader :video, :reanalysis
def aws_bucket_name
ENV["AWS_BUCKET"]
end
def response
@response ||= BrayniacAI::FacialRecognition.find(video.analysis_uid)
end
end