forked from apchenstu/TensoRF
-
Notifications
You must be signed in to change notification settings - Fork 1
/
fileServer.py
41 lines (31 loc) · 940 Bytes
/
fileServer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from flask import Flask, appcontext_popped
from flask import send_from_directory
import time
from multiprocessing import Process
import os
app = Flask(__name__)
@app.route('/output/videos/<path:path>')
def send_video(path):
return send_from_directory('output/videos',path)
@app.route('/output/models/<path:path>')
def send_model(path):
return send_from_directory('output/models',path)
def dummy_nerf():
count = 0
while(True):
print(f"Job {count} Started ")
time.sleep(1)
print(f"Job {count} complete")
print()
count+=1
def start_flask():
global app
app.run(debug=True)
# Demonstrating how files will be pulled from the cache
"""if __name__ == "__main__":
flaskProcess = Process(target=start_flask, args= ())
nerfProcess = Process(target=dummy_nerf, args= ())
flaskProcess.start()
nerfProcess.start()
flaskProcess.join()
nerfProcess.join()"""